@samchon/openapi
Advanced tools
Comparing version 0.1.2-dev.20240411 to 0.1.2-dev.20240411-2
@@ -129,3 +129,3 @@ "use strict"; | ||
const visit = (schema) => { | ||
var _a, _b, _c, _d, _e; | ||
var _a, _b, _c, _d, _e, _f, _g; | ||
// MIXED TYPE CASE | ||
@@ -220,3 +220,3 @@ if (TypeChecker.isMixed(schema)) { | ||
? convertSchema(schema.additionalItems) | ||
: schema.additionalItems, | ||
: (_f = schema.additionalItems) !== null && _f !== void 0 ? _f : false, | ||
})); | ||
@@ -230,7 +230,13 @@ else if (Array.isArray(schema.prefixItems)) | ||
? convertSchema(schema.additionalItems) | ||
: schema.additionalItems, | ||
: (_g = schema.additionalItems) !== null && _g !== void 0 ? _g : false, | ||
})); | ||
else if (schema.items === undefined) | ||
union.push(Object.assign(Object.assign({}, schema), { | ||
items: undefined, | ||
prefixItems: [], | ||
additionalItems: false, | ||
})); | ||
else | ||
union.push(Object.assign(Object.assign({}, schema), { | ||
items: schema.items ? convertSchema(schema.items) : undefined, | ||
items: convertSchema(schema.items), | ||
prefixItems: undefined, | ||
@@ -237,0 +243,0 @@ additionalItems: undefined, |
@@ -147,3 +147,3 @@ import { OpenApiV3 } from "./OpenApiV3"; | ||
interface IArray extends __ISignificant<"array"> { | ||
items?: IJsonSchema; | ||
items: IJsonSchema; | ||
/** @type uint */ minItems?: number; | ||
@@ -153,4 +153,5 @@ /** @type uint */ maxItems?: number; | ||
interface ITuple extends __ISignificant<"array"> { | ||
prefixItems?: IJsonSchema[]; | ||
additionalItems?: boolean | IJsonSchema; | ||
items: never; | ||
prefixItems: IJsonSchema[]; | ||
additionalItems: boolean | IJsonSchema; | ||
/** @type uint */ minItems?: number; | ||
@@ -157,0 +158,0 @@ /** @type uint */ maxItems?: number; |
{ | ||
"name": "@samchon/openapi", | ||
"version": "0.1.2-dev.20240411", | ||
"version": "0.1.2-dev.20240411-2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -363,3 +363,3 @@ import { OpenApi } from "../OpenApi"; | ||
...{ | ||
items: undefined, | ||
items: undefined!, | ||
prefixItems: schema.items.map(convertSchema), | ||
@@ -370,5 +370,5 @@ additionalItems: | ||
? convertSchema(schema.additionalItems) | ||
: schema.additionalItems, | ||
: schema.additionalItems ?? false, | ||
}, | ||
}); | ||
} satisfies OpenApi.IJsonSchema.ITuple); | ||
else if (Array.isArray(schema.prefixItems)) | ||
@@ -378,3 +378,3 @@ union.push({ | ||
...{ | ||
items: undefined, | ||
items: undefined!, | ||
prefixItems: schema.prefixItems.map(convertSchema), | ||
@@ -385,5 +385,14 @@ additionalItems: | ||
? convertSchema(schema.additionalItems) | ||
: schema.additionalItems, | ||
: schema.additionalItems ?? false, | ||
}, | ||
}); | ||
else if (schema.items === undefined) | ||
union.push({ | ||
...schema, | ||
...{ | ||
items: undefined!, | ||
prefixItems: [], | ||
additionalItems: false, | ||
}, | ||
}); | ||
else | ||
@@ -393,3 +402,3 @@ union.push({ | ||
...{ | ||
items: schema.items ? convertSchema(schema.items) : undefined, | ||
items: convertSchema(schema.items), | ||
prefixItems: undefined, | ||
@@ -396,0 +405,0 @@ additionalItems: undefined, |
@@ -235,3 +235,3 @@ import { OpenApiV3 } from "./OpenApiV3"; | ||
export interface IArray extends __ISignificant<"array"> { | ||
items?: IJsonSchema; | ||
items: IJsonSchema; | ||
/** @type uint */ minItems?: number; | ||
@@ -241,4 +241,5 @@ /** @type uint */ maxItems?: number; | ||
export interface ITuple extends __ISignificant<"array"> { | ||
prefixItems?: IJsonSchema[]; | ||
additionalItems?: boolean | IJsonSchema; | ||
items: never; | ||
prefixItems: IJsonSchema[]; | ||
additionalItems: boolean | IJsonSchema; | ||
/** @type uint */ minItems?: number; | ||
@@ -245,0 +246,0 @@ /** @type uint */ maxItems?: number; |
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
156106
4074