diff --git a/package.json b/package.json index f26fb16..1ab36a8 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/OpenApi.ts b/src/OpenApi.ts index 09f4e88..fbc7f86 100644 --- a/src/OpenApi.ts +++ b/src/OpenApi.ts @@ -82,7 +82,7 @@ export namespace OpenApi { >; security?: Record[]; tags?: IDocument.ITag[]; - "x-samchon-emended"?: boolean; + "x-samchon-emended": true; } export namespace IDocument { export interface IInfo { diff --git a/test/index.ts b/test/index.ts index 61c8d0c..5955aaa 100644 --- a/test/index.ts +++ b/test/index.ts @@ -39,10 +39,21 @@ const iterate = async (directory: string): Promise => { } }; const main = async (): Promise => { + // 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(document); + typia.assert(document); + } }; main().catch((exp) => { console.error(exp);