@samchon/openapi
Advanced tools
Comparing version 0.1.19 to 0.1.20
@@ -151,3 +151,4 @@ "use strict"; | ||
var _a; | ||
const matched = union.find((u) => u.type === value); | ||
const matched = union.find((u) => u.type === | ||
typeof value); | ||
if (matched !== undefined) { | ||
@@ -159,11 +160,13 @@ (_a = matched.enum) !== null && _a !== void 0 ? _a : (matched.enum = []); | ||
union.push({ type: typeof value, enum: [value] }); | ||
if (OpenApiTypeChecker_1.OpenApiTypeChecker.isConstant(schema)) | ||
insert(schema.const); | ||
else if (OpenApiTypeChecker_1.OpenApiTypeChecker.isOneOf(schema)) | ||
schema.oneOf.forEach(insert); | ||
}; | ||
if (OpenApiTypeChecker_1.OpenApiTypeChecker.isConstant(schema)) | ||
insert(schema.const); | ||
else if (OpenApiTypeChecker_1.OpenApiTypeChecker.isOneOf(schema)) | ||
for (const u of schema.oneOf) | ||
if (OpenApiTypeChecker_1.OpenApiTypeChecker.isConstant(u)) | ||
insert(u.const); | ||
}; | ||
visit(input); | ||
visitConstant(input); | ||
if (nullable) | ||
if (nullable === true) | ||
for (const u of union) | ||
@@ -170,0 +173,0 @@ if (OpenApiTypeChecker_1.OpenApiTypeChecker.isReference(u)) |
@@ -27,8 +27,9 @@ import { OpenApiV3 } from "./OpenApiV3"; | ||
* - JSON Schema | ||
* - Decomposed mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed} | ||
* - Resolved nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable} | ||
* - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed} | ||
* - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable} | ||
* - Array type utilizes only single {@link OpenAPI.IJsonSchema.IArray.items} | ||
* - Tuple type utilizes only {@link OpenApi.IJsonSchema.ITuple.prefixItems} | ||
* - Merged {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf} | ||
* - Merged {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link OpenApi.IJsonSchema.IObject} | ||
* | ||
@@ -35,0 +36,0 @@ * @author Jeongho Nam - https://github.com/samchon |
@@ -35,8 +35,9 @@ "use strict"; | ||
* - JSON Schema | ||
* - Decomposed mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed} | ||
* - Resolved nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable} | ||
* - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed} | ||
* - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable} | ||
* - Array type utilizes only single {@link OpenAPI.IJsonSchema.IArray.items} | ||
* - Tuple type utilizes only {@link OpenApi.IJsonSchema.ITuple.prefixItems} | ||
* - Merged {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf} | ||
* - Merged {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link OpenApi.IJsonSchema.IObject} | ||
* | ||
@@ -43,0 +44,0 @@ * @author Jeongho Nam - https://github.com/samchon |
{ | ||
"name": "@samchon/openapi", | ||
"version": "0.1.19", | ||
"version": "0.1.20", | ||
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.", | ||
@@ -32,2 +32,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@nestia/e2e": "^0.4.3", | ||
"@types/node": "^20.12.7", | ||
@@ -34,0 +35,0 @@ "prettier": "^3.2.5", |
@@ -29,11 +29,12 @@ # `@samchon/openapi` | ||
- Operation | ||
- Merged `OpenApiV3_1.IPathItem.parameters` to `OpenApi.IOperation.parameters` | ||
- Merge `OpenApiV3_1.IPathItem.parameters` to `OpenApi.IOperation.parameters` | ||
- Resolved references of `OpenApiV3_1.IOperation` mebers | ||
- JSON Schema | ||
- Decomposed mixed type: `OpenApiV3_1.IJsonSchema.IMixed` | ||
- Decompose mixed type: `OpenApiV3_1.IJsonSchema.IMixed` | ||
- Resolved nullable property: `OpenApiV3_1.IJsonSchema.__ISignificant.nullable` | ||
- Array type utilizes only single `OpenAPI.IJsonSchema.IArray.items` | ||
- Tuple type utilizes only `OpenApi.IJsonSchema.ITuple.prefixItems` | ||
- Merged `OpenApiV3_1.IJsonSchema.IAnyOf` to `OpenApi.IJsonSchema.IOneOf` | ||
- Merged `OpenApiV3_1.IJsonSchema.IRecursiveReference` to `OpenApi.IJsonSchema.IReference` | ||
- Merge `OpenApiV3_1.IJsonSchema.IAnyOf` to `OpenApi.IJsonSchema.IOneOf` | ||
- Merge `OpenApiV3_1.IJsonSchema.IRecursiveReference` to `OpenApi.IJsonSchema.IReference` | ||
- Merge `OpenApiV3_1.IJsonSchema.IAllOf` to `OpenApi.IJsonSchema.IObject` | ||
@@ -40,0 +41,0 @@ |
@@ -261,3 +261,4 @@ import { OpenApi } from "../OpenApi"; | ||
(u) => | ||
(u as OpenApiV3.IJsonSchema.__ISignificant<any>).type === value, | ||
(u as OpenApiV3.IJsonSchema.__ISignificant<any>).type === | ||
typeof value, | ||
) as OpenApiV3.IJsonSchema.INumber | undefined; | ||
@@ -268,6 +269,7 @@ if (matched !== undefined) { | ||
} else union.push({ type: typeof value as "number", enum: [value] }); | ||
if (OpenApiTypeChecker.isConstant(schema)) insert(schema.const); | ||
else if (OpenApiTypeChecker.isOneOf(schema)) | ||
schema.oneOf.forEach(insert); | ||
}; | ||
if (OpenApiTypeChecker.isConstant(schema)) insert(schema.const); | ||
else if (OpenApiTypeChecker.isOneOf(schema)) | ||
for (const u of schema.oneOf) | ||
if (OpenApiTypeChecker.isConstant(u)) insert(u.const); | ||
}; | ||
@@ -277,3 +279,3 @@ | ||
visitConstant(input); | ||
if (nullable) | ||
if (nullable === true) | ||
for (const u of union) | ||
@@ -283,3 +285,2 @@ if (OpenApiTypeChecker.isReference(u)) | ||
else (u as OpenApiV3.IJsonSchema.IArray).nullable = true; | ||
if (nullable === true && union.length === 0) | ||
@@ -286,0 +287,0 @@ return { type: "null", ...attribute }; |
@@ -33,8 +33,9 @@ import { OpenApiV3 } from "./OpenApiV3"; | ||
* - JSON Schema | ||
* - Decomposed mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed} | ||
* - Resolved nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable} | ||
* - Decompose mixed type: {@link OpenApiV3_1.IJsonSchema.IMixed} | ||
* - Resolve nullable property: {@link OpenApiV3_1.IJsonSchema.__ISignificant.nullable} | ||
* - Array type utilizes only single {@link OpenAPI.IJsonSchema.IArray.items} | ||
* - Tuple type utilizes only {@link OpenApi.IJsonSchema.ITuple.prefixItems} | ||
* - Merged {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf} | ||
* - Merged {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IAnyOf} to {@link OpenApi.IJsonSchema.IOneOf} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IRecursiveReference} to {@link OpenApi.IJsonSchema.IReference} | ||
* - Merge {@link OpenApiV3_1.IJsonSchema.IAllOf} to {@link OpenApi.IJsonSchema.IObject} | ||
* | ||
@@ -41,0 +42,0 @@ * @author Jeongho Nam - https://github.com/samchon |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
239887
5830
74
8