diff --git a/index.d.ts b/index.d.ts index f7a11a1..6359d23 100644 --- a/index.d.ts +++ b/index.d.ts @@ -102,10 +102,12 @@ interface Servers { } interface Options { + openapi?: string; info: InfoObject; 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 f441bd1..4f33772 100644 --- a/processSwagger.js +++ b/processSwagger.js @@ -14,10 +14,11 @@ 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, + jsonSchemaDialect: options.jsonSchemaDialect || 'https://json-schema.org/draft/2019-09/schema' }; swaggerObject = getBasicInfo(swaggerObject);