@tsed/schema 7.64.0 → 7.66.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.
- package/lib/browser/schema.umd.min.js +1 -1
- package/lib/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/components/open-spec/operationInQueryMapper.js +23 -1
- package/lib/cjs/components/open-spec/operationInQueryMapper.js.map +1 -1
- package/lib/esm/components/open-spec/operationInQueryMapper.js +23 -1
- package/lib/esm/components/open-spec/operationInQueryMapper.js.map +1 -1
- package/package.json +7 -7
|
@@ -4,6 +4,27 @@ exports.operationInQueryMapper = void 0;
|
|
|
4
4
|
const core_1 = require("@tsed/core");
|
|
5
5
|
const JsonSchemaMapperContainer_1 = require("../../registries/JsonSchemaMapperContainer");
|
|
6
6
|
const ref_1 = require("../../utils/ref");
|
|
7
|
+
function buildExamples(property, examples) {
|
|
8
|
+
if (!examples) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
let hasKey = false;
|
|
12
|
+
const newExamples = Object.entries(examples).reduce((acc, [key, { value, description, ...props }]) => {
|
|
13
|
+
if (value[property] === undefined) {
|
|
14
|
+
return acc;
|
|
15
|
+
}
|
|
16
|
+
hasKey = true;
|
|
17
|
+
return {
|
|
18
|
+
...acc,
|
|
19
|
+
[key]: {
|
|
20
|
+
...props,
|
|
21
|
+
value: value[property],
|
|
22
|
+
description
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}, {});
|
|
26
|
+
return hasKey ? newExamples : undefined;
|
|
27
|
+
}
|
|
7
28
|
function inlineReference(parameter, { jsonParameter, ...options }) {
|
|
8
29
|
const name = (0, ref_1.createRefName)(jsonParameter.$schema.getName(), options);
|
|
9
30
|
const schema = options.components?.schemas?.[name];
|
|
@@ -19,7 +40,8 @@ function inlineReference(parameter, { jsonParameter, ...options }) {
|
|
|
19
40
|
required: (schema?.required || []).includes(key),
|
|
20
41
|
description,
|
|
21
42
|
schema: prop,
|
|
22
|
-
style: prop.$ref ? "deepObject" : undefined
|
|
43
|
+
style: prop.$ref ? "deepObject" : undefined,
|
|
44
|
+
examples: buildExamples(key, parameter.examples)
|
|
23
45
|
})
|
|
24
46
|
];
|
|
25
47
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationInQueryMapper.js","sourceRoot":"","sources":["../../../../src/components/open-spec/operationInQueryMapper.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;
|
|
1
|
+
{"version":3,"file":"operationInQueryMapper.js","sourceRoot":"","sources":["../../../../src/components/open-spec/operationInQueryMapper.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAGvC,0FAAoF;AACpF,yCAA8C;AAG9C,SAAS,aAAa,CAAC,QAAgB,EAAE,QAAqC;IAC5E,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAC,CAAC,EAAE,EAAE;QACjG,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;YACjC,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,GAAG,IAAI,CAAC;QAEd,OAAO;YACL,GAAG,GAAG;YACN,CAAC,GAAG,CAAC,EAAE;gBACL,GAAG,KAAK;gBACR,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC;gBACtB,WAAW;aACZ;SACF,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC;AAED,SAAS,eAAe,CAAC,SAAc,EAAE,EAAC,aAAa,EAAE,GAAG,OAAO,EAAoB;IACrF,MAAM,I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AAC,KAAK,GAAG,YAAY,CAAC;KAChC;IAED,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC;IAE9B,OAAO,SAAS,CAAC;AACnB,CAAC;AAZD,wDAYC;AAED,IAAA,oDAAwB,EAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { cleanObject } from "@tsed/core";
|
|
2
2
|
import { registerJsonSchemaMapper } from "../../registries/JsonSchemaMapperContainer.js";
|
|
3
3
|
import { createRefName } from "../../utils/ref.js";
|
|
4
|
+
function buildExamples(property, examples) {
|
|
5
|
+
if (!examples) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
let hasKey = false;
|
|
9
|
+
const newExamples = Object.entries(examples).reduce((acc, [key, { value, description, ...props }]) => {
|
|
10
|
+
if (value[property] === undefined) {
|
|
11
|
+
return acc;
|
|
12
|
+
}
|
|
13
|
+
hasKey = true;
|
|
14
|
+
return {
|
|
15
|
+
...acc,
|
|
16
|
+
[key]: {
|
|
17
|
+
...props,
|
|
18
|
+
value: value[property],
|
|
19
|
+
description
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}, {});
|
|
23
|
+
return hasKey ? newExamples : undefined;
|
|
24
|
+
}
|
|
4
25
|
function inlineReference(parameter, { jsonParameter, ...options }) {
|
|
5
26
|
const name = createRefName(jsonParameter.$schema.getName(), options);
|
|
6
27
|
const schema = options.components?.schemas?.[name];
|
|
@@ -16,7 +37,8 @@ function inlineReference(parameter, { jsonParameter, ...options }) {
|
|
|
16
37
|
required: (schema?.required || []).includes(key),
|
|
17
38
|
description,
|
|
18
39
|
schema: prop,
|
|
19
|
-
style: prop.$ref ? "deepObject" : undefined
|
|
40
|
+
style: prop.$ref ? "deepObject" : undefined,
|
|
41
|
+
examples: buildExamples(key, parameter.examples)
|
|
20
42
|
})
|
|
21
43
|
];
|
|
22
44
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operationInQueryMapper.js","sourceRoot":"","sources":["../../../../src/components/open-spec/operationInQueryMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"operationInQueryMapper.js","sourceRoot":"","sources":["../../../../src/components/open-spec/operationInQueryMapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,YAAY,CAAC;AAGvC,OAAO,EAAC,wBAAwB,EAAC,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,SAAS,aAAa,CAAC,QAAgB,EAAE,QAAqC;IAC5E,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,EAAC,CAAC,EAAE,EAAE;QACjG,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE;YACjC,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,GAAG,IAAI,CAAC;QAEd,OAAO;YACL,GAAG,GAAG;YACN,CAAC,GAAG,CAAC,EAAE;gBACL,GAAG,KAAK;gBACR,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC;gBACtB,WAAW;aACZ;SACF,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1C,CAAC;AAED,SAAS,eAAe,CAAC,SAAc,EAAE,EAAC,aAAa,EAAE,GAAG,OAAO,EAAoB;IACrF,MAAM,IAAI,GAAG,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC,OAA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AG,UAAU,CAAC;IAE9B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,wBAAwB,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.66.0",
|
|
4
4
|
"description": "JsonSchema module for Ts.ED Framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"tsed"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@tsed/openspec": "7.
|
|
36
|
+
"@tsed/openspec": "7.66.0",
|
|
37
37
|
"change-case": "^4.1.2",
|
|
38
38
|
"fs-extra": "^11.1.1",
|
|
39
39
|
"json-schema": "0.4.0",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@tsed/core": "7.
|
|
47
|
-
"@tsed/openspec": "7.
|
|
48
|
-
"@tsed/typescript": "7.
|
|
46
|
+
"@tsed/core": "7.66.0",
|
|
47
|
+
"@tsed/openspec": "7.66.0",
|
|
48
|
+
"@tsed/typescript": "7.66.0",
|
|
49
49
|
"@types/fs-extra": "11.0.3",
|
|
50
50
|
"@types/json-schema": "7.0.11",
|
|
51
51
|
"@types/picomatch": "2.3.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"picomatch-browser": "^2.2.6"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@tsed/core": "7.
|
|
60
|
-
"@tsed/openspec": "7.
|
|
59
|
+
"@tsed/core": "7.66.0",
|
|
60
|
+
"@tsed/openspec": "7.66.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@tsed/core": {
|