Skip to content

Commit

Permalink
OpenApi.IDocument["x-samchon-emended"] becomes required.
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Apr 14, 2024
1 parent 1f9821c commit 7b8cbc9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 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.7",
"version": "0.1.8",
"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 @@ -82,7 +82,7 @@ export namespace OpenApi {
>;
security?: Record<string, string[]>[];
tags?: IDocument.ITag[];
"x-samchon-emended"?: boolean;
"x-samchon-emended": true;
}
export namespace IDocument {
export interface IInfo {
Expand Down
13 changes: 12 additions & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,21 @@ const iterate = async (directory: string): Promise<void> => {
}
};
const main = async (): Promise<void> => {
// TEST CONVERSION
const NORMALIZED: string = `${__dirname}/../../examples/normalized`;
try {
await fs.promises.mkdir(`${__dirname}/../../examples/normalized`);
await fs.promises.mkdir(NORMALIZED);
} catch {}
await iterate(`${__dirname}/../../examples`);

// TYPE ASSERTIONS
for (const file of await fs.promises.readdir(NORMALIZED)) {
const document: OpenApi.IDocument = JSON.parse(
await fs.promises.readFile(`${NORMALIZED}/${file}`, "utf8"),
);
typia.assert<OpenApi.IDocument>(document);
typia.assert<OpenApiV3_1.IDocument>(document);
}
};
main().catch((exp) => {
console.error(exp);
Expand Down

0 comments on commit 7b8cbc9

Please sign in to comment.