Skip to content

Commit

Permalink
Merge pull request #13 from samchon/features/tuple
Browse files Browse the repository at this point in the history
`IJsonSchema.ITuple.additionalItems` to be optional.
  • Loading branch information
samchon authored Apr 17, 2024
2 parents f2af77f + cc43067 commit 011a2a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@samchon/openapi",
"version": "0.1.15",
"version": "0.1.16",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/OpenApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export namespace OpenApi {
}
export interface ITuple extends __ISignificant<"array"> {
prefixItems: IJsonSchema[];
additionalItems: boolean | IJsonSchema;
additionalItems?: boolean | IJsonSchema;
/** @type uint64 */ minItems?: number;
/** @type uint64 */ maxItems?: number;
}
Expand Down
5 changes: 2 additions & 3 deletions src/internal/OpenApiV3_1Converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ export namespace OpenApiV3_1Converter {
typeof schema.additionalItems === "object" &&
schema.additionalItems !== null
? convertSchema(schema.additionalItems)
: schema.additionalItems ?? false,
: schema.additionalItems,
},
} satisfies OpenApi.IJsonSchema.ITuple);
else if (Array.isArray(schema.prefixItems))
Expand All @@ -403,7 +403,7 @@ export namespace OpenApiV3_1Converter {
typeof schema.additionalItems === "object" &&
schema.additionalItems !== null
? convertSchema(schema.additionalItems)
: schema.additionalItems ?? false,
: schema.additionalItems,
},
});
else if (schema.items === undefined)
Expand All @@ -412,7 +412,6 @@ export namespace OpenApiV3_1Converter {
...{
items: undefined!,
prefixItems: [],
additionalItems: false,
},
});
else
Expand Down

0 comments on commit 011a2a1

Please sign in to comment.