From abbb9f25f099c9bb8c307a5ab3df68019535745f Mon Sep 17 00:00:00 2001 From: Deepak Bhardwaj <46839821+imdkbj@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:34:09 +0530 Subject: [PATCH 1/3] Update processSwagger.js Added optional openapi specification --- processSwagger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processSwagger.js b/processSwagger.js index f441bd1..536c7ae 100644 --- a/processSwagger.js +++ b/processSwagger.js @@ -14,7 +14,7 @@ const defaultLogger = () => null; const processSwagger = (options, logger = defaultLogger) => { let swaggerObject = { - openapi: '3.0.0', + openapi: options.openapi || '3.0.0', info: options.info, servers: options.servers, security: options.security, From b8a80c9d01c01754ac122fc4c8d8789a0e561231 Mon Sep 17 00:00:00 2001 From: Deepak Bhardwaj <46839821+imdkbj@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:37:15 +0530 Subject: [PATCH 2/3] Update index.d.ts Updated type for openapi --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index f7a11a1..3069b45 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,6 +102,7 @@ interface Servers { } interface Options { + openapi?: string; info: InfoObject; baseDir: string; filesPattern: string | string[]; From 9bea8c9aa797caa8e9591c9d83ddc2de08b57371 Mon Sep 17 00:00:00 2001 From: Deepak Bhardwaj <46839821+imdkbj@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:24:36 +0530 Subject: [PATCH 3/3] add : jsonSchemaDialect --- index.d.ts | 1 + processSwagger.js | 1 + 2 files changed, 2 insertions(+) diff --git a/index.d.ts b/index.d.ts index 3069b45..6359d23 100644 --- a/index.d.ts +++ b/index.d.ts @@ -107,6 +107,7 @@ interface Options { baseDir: string; filesPattern: string | string[]; security?: Security; + jsonSchemaDialect?: string; servers?: string[] | Servers[]; exposeSwaggerUI?: boolean; swaggerUIPath?: string; diff --git a/processSwagger.js b/processSwagger.js index 536c7ae..4f33772 100644 --- a/processSwagger.js +++ b/processSwagger.js @@ -18,6 +18,7 @@ const processSwagger = (options, logger = defaultLogger) => { info: options.info, servers: options.servers, security: options.security, + jsonSchemaDialect: options.jsonSchemaDialect || 'https://json-schema.org/draft/2019-09/schema' }; swaggerObject = getBasicInfo(swaggerObject);