@tsed/schema 8.25.4 → 8.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, isArray, isCollection, isPlainObject, isPrimitiveOrPrimitiveClass, isString } from "@tsed/core";
|
|
1
|
+
import { decorateMethodsOf, decoratorTypeOf, DecoratorTypes, isArray, isClass, isCollection, isPlainObject, isPrimitiveOrPrimitiveClass, isString } from "@tsed/core";
|
|
2
2
|
import { getStatusMessage } from "../../constants/httpStatusMessages.js";
|
|
3
3
|
import { DecoratorContext } from "../../domain/DecoratorContext.js";
|
|
4
4
|
import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
|
|
@@ -251,8 +251,8 @@ class ReturnDecoratorContext extends DecoratorContext {
|
|
|
251
251
|
}
|
|
252
252
|
export function Returns(status, model) {
|
|
253
253
|
const context = new ReturnDecoratorContext({
|
|
254
|
-
status,
|
|
255
|
-
model
|
|
254
|
+
status: isClass(status) ? 200 : status,
|
|
255
|
+
model: isClass(status) ? status : model
|
|
256
256
|
});
|
|
257
257
|
return context.build();
|
|
258
258
|
}
|
|
@@ -41,7 +41,7 @@ export function getJsonPathParameters(base, path = "") {
|
|
|
41
41
|
let isOptional = false;
|
|
42
42
|
let current = "";
|
|
43
43
|
parseUrl(`${base}${path}`).map((key) => {
|
|
44
|
-
const subpath = key.replace(":", "").replace("?", "");
|
|
44
|
+
const subpath = key.replace(":", "").replace("?", "").replace(/\*/g, "");
|
|
45
45
|
if (key.includes(":")) {
|
|
46
46
|
const optional = key.includes("?");
|
|
47
47
|
// Append previous config
|
|
@@ -265,4 +265,5 @@ export interface ReturnsChainedDecorators {
|
|
|
265
265
|
* @response
|
|
266
266
|
* @operation
|
|
267
267
|
*/
|
|
268
|
+
export declare function Returns(model?: Type<any> | Type<any>[]): ReturnsChainedDecorators;
|
|
268
269
|
export declare function Returns(status?: string | number, model?: Type<any> | Type<any>[]): ReturnsChainedDecorators;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
3
|
"description": "JsonSchema module for Ts.ED Framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.26.0",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"tsed"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@tsed/openspec": "8.
|
|
37
|
+
"@tsed/openspec": "8.26.0",
|
|
38
38
|
"change-case": "^5.4.4",
|
|
39
39
|
"json-schema": "0.4.0",
|
|
40
|
-
"picomatch": "4.0.
|
|
40
|
+
"picomatch": "4.0.4",
|
|
41
41
|
"statuses": "^2.0.1",
|
|
42
|
-
"tslib": "2.7.0"
|
|
42
|
+
"tslib": ">=2.7.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.1.0",
|
|
46
|
-
"@tsed/barrels": "8.
|
|
47
|
-
"@tsed/core": "8.
|
|
48
|
-
"@tsed/hooks": "8.
|
|
49
|
-
"@tsed/openspec": "8.
|
|
50
|
-
"@tsed/typescript": "8.
|
|
46
|
+
"@tsed/barrels": "8.26.0",
|
|
47
|
+
"@tsed/core": "8.26.0",
|
|
48
|
+
"@tsed/hooks": "8.26.0",
|
|
49
|
+
"@tsed/openspec": "8.26.0",
|
|
50
|
+
"@tsed/typescript": "8.26.0",
|
|
51
51
|
"@types/fs-extra": "11.0.4",
|
|
52
52
|
"@types/json-schema": "7.0.15",
|
|
53
53
|
"@types/picomatch": "3.0.2",
|