@tsed/schema 7.75.2 → 7.75.4
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/jest.config.js +1 -1
- package/lib/browser/schema.umd.min.js +1 -1
- package/lib/browser/schema.umd.min.js.map +1 -1
- package/lib/cjs/constants/jsonSchemaProperties.js +21 -0
- package/lib/cjs/constants/jsonSchemaProperties.js.map +1 -0
- package/lib/cjs/decorators/common/allow.js +1 -1
- package/lib/cjs/decorators/common/allow.js.map +1 -1
- package/lib/cjs/domain/JsonSchema.js +71 -45
- package/lib/cjs/domain/JsonSchema.js.map +1 -1
- package/lib/cjs/hooks/alterOneOf.js +41 -5
- package/lib/cjs/hooks/alterOneOf.js.map +1 -1
- package/lib/cjs/index.js +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/getRequiredProperties.js +0 -18
- package/lib/cjs/utils/getRequiredProperties.js.map +1 -1
- package/lib/cjs/utils/mapNullableType.js +44 -21
- package/lib/cjs/utils/mapNullableType.js.map +1 -1
- package/lib/cjs/utils/ref.js +9 -19
- package/lib/cjs/utils/ref.js.map +1 -1
- package/lib/esm/constants/jsonSchemaProperties.js +18 -0
- package/lib/esm/constants/jsonSchemaProperties.js.map +1 -0
- package/lib/esm/decorators/common/allow.js +1 -1
- package/lib/esm/decorators/common/allow.js.map +1 -1
- package/lib/esm/domain/JsonSchema.js +71 -45
- package/lib/esm/domain/JsonSchema.js.map +1 -1
- package/lib/esm/hooks/alterOneOf.js +41 -5
- package/lib/esm/hooks/alterOneOf.js.map +1 -1
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/getRequiredProperties.js +0 -18
- package/lib/esm/utils/getRequiredProperties.js.map +1 -1
- package/lib/esm/utils/mapNullableType.js +45 -22
- package/lib/esm/utils/mapNullableType.js.map +1 -1
- package/lib/esm/utils/ref.js +9 -19
- package/lib/esm/utils/ref.js.map +1 -1
- package/lib/types/constants/jsonSchemaProperties.d.ts +7 -0
- package/lib/types/domain/JsonSchema.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +8 -8
package/lib/esm/utils/ref.js
CHANGED
|
@@ -26,27 +26,17 @@ export function createRef(name, schema, options) {
|
|
|
26
26
|
const ref = {
|
|
27
27
|
$ref: `${host}/${name}`
|
|
28
28
|
};
|
|
29
|
-
const nullable = schema.isNullable;
|
|
30
29
|
const readOnly = schema.isReadOnly;
|
|
31
30
|
const writeOnly = schema.isWriteOnly;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
case SpecTypes.JSON:
|
|
42
|
-
return cleanObject({
|
|
43
|
-
readOnly,
|
|
44
|
-
writeOnly,
|
|
45
|
-
oneOf: [ref]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return ref;
|
|
31
|
+
return cleanObject({
|
|
32
|
+
readOnly: readOnly ? true : undefined,
|
|
33
|
+
writeOnly: writeOnly ? true : undefined,
|
|
34
|
+
...(readOnly || writeOnly
|
|
35
|
+
? {
|
|
36
|
+
anyOf: [ref]
|
|
37
|
+
}
|
|
38
|
+
: ref)
|
|
39
|
+
});
|
|
50
40
|
}
|
|
51
41
|
/**
|
|
52
42
|
* @ignore
|
package/lib/esm/utils/ref.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../src/utils/ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACjD,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../src/utils/ref.ts"],"names":[],"mappings":"AAA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C,SAAS;QACvC,GAAG,CAAC,QAAQ,IAAI,SAAS;YACvB,CAAC,CAAC;gBACE,KAAK,EAAE,CAAC,GAAG,CAAC;aACb;YACH,CAAC,CAAC,GAAG,CAAC;KACT,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,KAAiB,EAAE,MAAW,EAAE,OAA0B;IAC9E,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAErD,QAAQ,CAAC,OAAO,EAAE,sBAAsB,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAExD,OAAO,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const MANY_OF_PROPERTIES: string[];
|
|
2
|
+
export declare const STRING_PROPERTIES: string[];
|
|
3
|
+
export declare const BOOLEAN_PROPERTIES: never[];
|
|
4
|
+
export declare const NUMBER_PROPERTIES: string[];
|
|
5
|
+
export declare const ARRAY_PROPERTIES: string[];
|
|
6
|
+
export declare const OBJECT_PROPERTIES: string[];
|
|
7
|
+
export declare const COMMON_PROPERTIES: string[];
|
package/lib/types/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from "./components/open-spec/operationRequestBodyMapper.js";
|
|
|
29
29
|
export * from "./components/open-spec/operationResponseMapper.js";
|
|
30
30
|
export * from "./components/open-spec/pathsMapper.js";
|
|
31
31
|
export * from "./constants/httpStatusMessages.js";
|
|
32
|
+
export * from "./constants/jsonSchemaProperties.js";
|
|
32
33
|
export * from "./constants/OperationVerbs.js";
|
|
33
34
|
export * from "./decorators/class/children.js";
|
|
34
35
|
export * from "./decorators/class/discriminatorValue.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/schema",
|
|
3
|
-
"version": "7.75.
|
|
3
|
+
"version": "7.75.4",
|
|
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.75.
|
|
36
|
+
"@tsed/openspec": "7.75.4",
|
|
37
37
|
"change-case": "^4.1.2",
|
|
38
38
|
"fs-extra": "^11.2.0",
|
|
39
39
|
"json-schema": "0.4.0",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.1.0",
|
|
46
|
-
"@tsed/barrels": "7.75.
|
|
47
|
-
"@tsed/core": "7.75.
|
|
48
|
-
"@tsed/openspec": "7.75.
|
|
49
|
-
"@tsed/typescript": "7.75.
|
|
46
|
+
"@tsed/barrels": "7.75.4",
|
|
47
|
+
"@tsed/core": "7.75.4",
|
|
48
|
+
"@tsed/openspec": "7.75.4",
|
|
49
|
+
"@tsed/typescript": "7.75.4",
|
|
50
50
|
"@types/fs-extra": "11.0.4",
|
|
51
51
|
"@types/json-schema": "7.0.15",
|
|
52
52
|
"@types/picomatch": "2.3.3",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"picomatch-browser": "^2.2.6"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@tsed/core": "7.75.
|
|
60
|
-
"@tsed/openspec": "7.75.
|
|
59
|
+
"@tsed/core": "7.75.4",
|
|
60
|
+
"@tsed/openspec": "7.75.4"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@tsed/core": {
|