openapi3-ts
Advanced tools
Comparing version 4.0.2 to 4.0.3
# Changelog: openapi3-ts | ||
## Version 4.0.3 | ||
2023.03.30 | ||
- Bug fix. Stricter TS compilation. Fix issue [#105](https://github.com/metadevpro/openapi3-ts/issues/105) | ||
## Version 4.0.2 | ||
@@ -4,0 +10,0 @@ |
@@ -92,2 +92,4 @@ "use strict"; | ||
addSchema(name, schema) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.schemas = this.rootDoc.components.schemas || {}; | ||
this.rootDoc.components.schemas[name] = schema; | ||
@@ -97,2 +99,4 @@ return this; | ||
addResponse(name, response) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.responses = this.rootDoc.components.responses || {}; | ||
this.rootDoc.components.responses[name] = response; | ||
@@ -102,2 +106,4 @@ return this; | ||
addParameter(name, parameter) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.parameters = this.rootDoc.components.parameters || {}; | ||
this.rootDoc.components.parameters[name] = parameter; | ||
@@ -107,2 +113,4 @@ return this; | ||
addExample(name, example) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.examples = this.rootDoc.components.examples || {}; | ||
this.rootDoc.components.examples[name] = example; | ||
@@ -112,2 +120,4 @@ return this; | ||
addRequestBody(name, reqBody) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.requestBodies = this.rootDoc.components.requestBodies || {}; | ||
this.rootDoc.components.requestBodies[name] = reqBody; | ||
@@ -117,2 +127,4 @@ return this; | ||
addHeader(name, header) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.headers = this.rootDoc.components.headers || {}; | ||
this.rootDoc.components.headers[name] = header; | ||
@@ -122,2 +134,4 @@ return this; | ||
addSecurityScheme(name, secScheme) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.securitySchemes = this.rootDoc.components.securitySchemes || {}; | ||
this.rootDoc.components.securitySchemes[name] = secScheme; | ||
@@ -127,2 +141,4 @@ return this; | ||
addLink(name, link) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.links = this.rootDoc.components.links || {}; | ||
this.rootDoc.components.links[name] = link; | ||
@@ -132,2 +148,4 @@ return this; | ||
addCallback(name, callback) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.callbacks = this.rootDoc.components.callbacks || {}; | ||
this.rootDoc.components.callbacks[name] = callback; | ||
@@ -137,2 +155,3 @@ return this; | ||
addServer(server) { | ||
this.rootDoc.servers = this.rootDoc.servers || []; | ||
this.rootDoc.servers.push(server); | ||
@@ -142,2 +161,3 @@ return this; | ||
addTag(tag) { | ||
this.rootDoc.tags = this.rootDoc.tags || []; | ||
this.rootDoc.tags.push(tag); | ||
@@ -152,1 +172,2 @@ return this; | ||
exports.OpenApiBuilder = OpenApiBuilder; | ||
//# sourceMappingURL=openapi-builder30.js.map |
@@ -88,2 +88,3 @@ "use strict"; | ||
addPath(path, pathItem) { | ||
this.rootDoc.paths = this.rootDoc.paths || []; | ||
this.rootDoc.paths[path] = Object.assign(Object.assign({}, (this.rootDoc.paths[path] || {})), pathItem); | ||
@@ -93,2 +94,4 @@ return this; | ||
addSchema(name, schema) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.schemas = this.rootDoc.components.schemas || {}; | ||
this.rootDoc.components.schemas[name] = schema; | ||
@@ -98,2 +101,4 @@ return this; | ||
addResponse(name, response) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.responses = this.rootDoc.components.responses || {}; | ||
this.rootDoc.components.responses[name] = response; | ||
@@ -103,2 +108,4 @@ return this; | ||
addParameter(name, parameter) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.parameters = this.rootDoc.components.parameters || {}; | ||
this.rootDoc.components.parameters[name] = parameter; | ||
@@ -108,2 +115,4 @@ return this; | ||
addExample(name, example) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.examples = this.rootDoc.components.examples || {}; | ||
this.rootDoc.components.examples[name] = example; | ||
@@ -113,2 +122,4 @@ return this; | ||
addRequestBody(name, reqBody) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.requestBodies = this.rootDoc.components.requestBodies || {}; | ||
this.rootDoc.components.requestBodies[name] = reqBody; | ||
@@ -118,2 +129,4 @@ return this; | ||
addHeader(name, header) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.headers = this.rootDoc.components.headers || {}; | ||
this.rootDoc.components.headers[name] = header; | ||
@@ -123,2 +136,4 @@ return this; | ||
addSecurityScheme(name, secScheme) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.securitySchemes = this.rootDoc.components.securitySchemes || {}; | ||
this.rootDoc.components.securitySchemes[name] = secScheme; | ||
@@ -128,2 +143,4 @@ return this; | ||
addLink(name, link) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.links = this.rootDoc.components.links || {}; | ||
this.rootDoc.components.links[name] = link; | ||
@@ -133,2 +150,4 @@ return this; | ||
addCallback(name, callback) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.callbacks = this.rootDoc.components.callbacks || {}; | ||
this.rootDoc.components.callbacks[name] = callback; | ||
@@ -138,2 +157,3 @@ return this; | ||
addServer(server) { | ||
this.rootDoc.servers = this.rootDoc.servers || []; | ||
this.rootDoc.servers.push(server); | ||
@@ -143,2 +163,3 @@ return this; | ||
addTag(tag) { | ||
this.rootDoc.tags = this.rootDoc.tags || []; | ||
this.rootDoc.tags.push(tag); | ||
@@ -160,1 +181,2 @@ return this; | ||
exports.OpenApiBuilder = OpenApiBuilder; | ||
//# sourceMappingURL=openapi-builder31.js.map |
@@ -9,1 +9,2 @@ "use strict"; | ||
Object.defineProperty(exports, "ServerVariable", { enumerable: true, get: function () { return server_1.ServerVariable; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -21,1 +21,2 @@ "use strict"; | ||
exports.addExtension = addExtension; | ||
//# sourceMappingURL=oas-common.js.map |
@@ -37,1 +37,2 @@ "use strict"; | ||
exports.isSchemaObject = isSchemaObject; | ||
//# sourceMappingURL=openapi30.js.map |
@@ -37,1 +37,2 @@ "use strict"; | ||
exports.isSchemaObject = isSchemaObject; | ||
//# sourceMappingURL=openapi31.js.map |
@@ -23,1 +23,2 @@ "use strict"; | ||
exports.ServerVariable = ServerVariable; | ||
//# sourceMappingURL=server.js.map |
@@ -36,1 +36,2 @@ "use strict"; | ||
exports.SpecificationExtension = SpecificationExtension; | ||
//# sourceMappingURL=specification-extension.js.map |
@@ -23,1 +23,2 @@ "use strict"; | ||
Object.defineProperty(exports, "ServerVariable", { enumerable: true, get: function () { return server_1.ServerVariable; } }); | ||
//# sourceMappingURL=oas30.js.map |
@@ -23,1 +23,2 @@ "use strict"; | ||
Object.defineProperty(exports, "ServerVariable", { enumerable: true, get: function () { return server_1.ServerVariable; } }); | ||
//# sourceMappingURL=oas31.js.map |
@@ -89,2 +89,4 @@ import * as yaml from 'yaml'; | ||
addSchema(name, schema) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.schemas = this.rootDoc.components.schemas || {}; | ||
this.rootDoc.components.schemas[name] = schema; | ||
@@ -94,2 +96,4 @@ return this; | ||
addResponse(name, response) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.responses = this.rootDoc.components.responses || {}; | ||
this.rootDoc.components.responses[name] = response; | ||
@@ -99,2 +103,4 @@ return this; | ||
addParameter(name, parameter) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.parameters = this.rootDoc.components.parameters || {}; | ||
this.rootDoc.components.parameters[name] = parameter; | ||
@@ -104,2 +110,4 @@ return this; | ||
addExample(name, example) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.examples = this.rootDoc.components.examples || {}; | ||
this.rootDoc.components.examples[name] = example; | ||
@@ -109,2 +117,4 @@ return this; | ||
addRequestBody(name, reqBody) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.requestBodies = this.rootDoc.components.requestBodies || {}; | ||
this.rootDoc.components.requestBodies[name] = reqBody; | ||
@@ -114,2 +124,4 @@ return this; | ||
addHeader(name, header) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.headers = this.rootDoc.components.headers || {}; | ||
this.rootDoc.components.headers[name] = header; | ||
@@ -119,2 +131,4 @@ return this; | ||
addSecurityScheme(name, secScheme) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.securitySchemes = this.rootDoc.components.securitySchemes || {}; | ||
this.rootDoc.components.securitySchemes[name] = secScheme; | ||
@@ -124,2 +138,4 @@ return this; | ||
addLink(name, link) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.links = this.rootDoc.components.links || {}; | ||
this.rootDoc.components.links[name] = link; | ||
@@ -129,2 +145,4 @@ return this; | ||
addCallback(name, callback) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.callbacks = this.rootDoc.components.callbacks || {}; | ||
this.rootDoc.components.callbacks[name] = callback; | ||
@@ -134,2 +152,3 @@ return this; | ||
addServer(server) { | ||
this.rootDoc.servers = this.rootDoc.servers || []; | ||
this.rootDoc.servers.push(server); | ||
@@ -139,2 +158,3 @@ return this; | ||
addTag(tag) { | ||
this.rootDoc.tags = this.rootDoc.tags || []; | ||
this.rootDoc.tags.push(tag); | ||
@@ -148,1 +168,2 @@ return this; | ||
} | ||
//# sourceMappingURL=openapi-builder30.js.map |
@@ -85,2 +85,3 @@ import * as yaml from 'yaml'; | ||
addPath(path, pathItem) { | ||
this.rootDoc.paths = this.rootDoc.paths || []; | ||
this.rootDoc.paths[path] = { ...(this.rootDoc.paths[path] || {}), ...pathItem }; | ||
@@ -90,2 +91,4 @@ return this; | ||
addSchema(name, schema) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.schemas = this.rootDoc.components.schemas || {}; | ||
this.rootDoc.components.schemas[name] = schema; | ||
@@ -95,2 +98,4 @@ return this; | ||
addResponse(name, response) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.responses = this.rootDoc.components.responses || {}; | ||
this.rootDoc.components.responses[name] = response; | ||
@@ -100,2 +105,4 @@ return this; | ||
addParameter(name, parameter) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.parameters = this.rootDoc.components.parameters || {}; | ||
this.rootDoc.components.parameters[name] = parameter; | ||
@@ -105,2 +112,4 @@ return this; | ||
addExample(name, example) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.examples = this.rootDoc.components.examples || {}; | ||
this.rootDoc.components.examples[name] = example; | ||
@@ -110,2 +119,4 @@ return this; | ||
addRequestBody(name, reqBody) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.requestBodies = this.rootDoc.components.requestBodies || {}; | ||
this.rootDoc.components.requestBodies[name] = reqBody; | ||
@@ -115,2 +126,4 @@ return this; | ||
addHeader(name, header) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.headers = this.rootDoc.components.headers || {}; | ||
this.rootDoc.components.headers[name] = header; | ||
@@ -120,2 +133,4 @@ return this; | ||
addSecurityScheme(name, secScheme) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.securitySchemes = this.rootDoc.components.securitySchemes || {}; | ||
this.rootDoc.components.securitySchemes[name] = secScheme; | ||
@@ -125,2 +140,4 @@ return this; | ||
addLink(name, link) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.links = this.rootDoc.components.links || {}; | ||
this.rootDoc.components.links[name] = link; | ||
@@ -130,2 +147,4 @@ return this; | ||
addCallback(name, callback) { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.callbacks = this.rootDoc.components.callbacks || {}; | ||
this.rootDoc.components.callbacks[name] = callback; | ||
@@ -135,2 +154,3 @@ return this; | ||
addServer(server) { | ||
this.rootDoc.servers = this.rootDoc.servers || []; | ||
this.rootDoc.servers.push(server); | ||
@@ -140,2 +160,3 @@ return this; | ||
addTag(tag) { | ||
this.rootDoc.tags = this.rootDoc.tags || []; | ||
this.rootDoc.tags.push(tag); | ||
@@ -155,1 +176,2 @@ return this; | ||
} | ||
//# sourceMappingURL=openapi-builder31.js.map |
export * as oas30 from "./oas30"; | ||
export * as oas31 from "./oas31"; | ||
export { Server, ServerVariable } from "./model/server"; | ||
//# sourceMappingURL=index.js.map |
@@ -16,1 +16,2 @@ import { SpecificationExtension } from './specification-extension'; | ||
} | ||
//# sourceMappingURL=oas-common.js.map |
@@ -16,1 +16,2 @@ import { SpecificationExtension } from './specification-extension'; | ||
} | ||
//# sourceMappingURL=openapi30.js.map |
@@ -16,1 +16,2 @@ import { SpecificationExtension } from './specification-extension'; | ||
} | ||
//# sourceMappingURL=openapi31.js.map |
@@ -18,1 +18,2 @@ export class Server { | ||
} | ||
//# sourceMappingURL=server.js.map |
@@ -32,1 +32,2 @@ export class SpecificationExtension { | ||
} | ||
//# sourceMappingURL=specification-extension.js.map |
export * from './dsl/openapi-builder30'; | ||
export * from './model/openapi30'; | ||
export { Server, ServerVariable } from './model/server'; | ||
//# sourceMappingURL=oas30.js.map |
export * from './dsl/openapi-builder31'; | ||
export * from './model/openapi31'; | ||
export { Server, ServerVariable } from './model/server'; | ||
//# sourceMappingURL=oas31.js.map |
{ | ||
"name": "openapi3-ts", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "TS Model & utils for OpenAPI 3.x specification.", | ||
@@ -49,3 +49,3 @@ "main": "dist/cjs/index.js", | ||
"rimraf": "^4.4.1", | ||
"typescript": "~5.0.2", | ||
"typescript": "~5.0.3", | ||
"vitest": "^0.29.8", | ||
@@ -52,0 +52,0 @@ "vitest-teamcity-reporter": "^0.1.12" |
@@ -106,2 +106,4 @@ import * as yaml from 'yaml'; | ||
addSchema(name: string, schema: oa.SchemaObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.schemas = this.rootDoc.components.schemas || {}; | ||
this.rootDoc.components.schemas[name] = schema; | ||
@@ -111,2 +113,4 @@ return this; | ||
addResponse(name: string, response: oa.ResponseObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.responses = this.rootDoc.components.responses || {}; | ||
this.rootDoc.components.responses[name] = response; | ||
@@ -116,2 +120,4 @@ return this; | ||
addParameter(name: string, parameter: oa.ParameterObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.parameters = this.rootDoc.components.parameters || {}; | ||
this.rootDoc.components.parameters[name] = parameter; | ||
@@ -121,2 +127,4 @@ return this; | ||
addExample(name: string, example: oa.ExampleObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.examples = this.rootDoc.components.examples || {}; | ||
this.rootDoc.components.examples[name] = example; | ||
@@ -129,2 +137,4 @@ return this; | ||
): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.requestBodies = this.rootDoc.components.requestBodies || {}; | ||
this.rootDoc.components.requestBodies[name] = reqBody; | ||
@@ -134,2 +144,4 @@ return this; | ||
addHeader(name: string, header: oa.HeaderObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.headers = this.rootDoc.components.headers || {}; | ||
this.rootDoc.components.headers[name] = header; | ||
@@ -142,2 +154,4 @@ return this; | ||
): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.securitySchemes = this.rootDoc.components.securitySchemes || {}; | ||
this.rootDoc.components.securitySchemes[name] = secScheme; | ||
@@ -147,2 +161,4 @@ return this; | ||
addLink(name: string, link: oa.LinkObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.links = this.rootDoc.components.links || {}; | ||
this.rootDoc.components.links[name] = link; | ||
@@ -152,2 +168,4 @@ return this; | ||
addCallback(name: string, callback: oa.CallbackObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.callbacks = this.rootDoc.components.callbacks || {}; | ||
this.rootDoc.components.callbacks[name] = callback; | ||
@@ -157,2 +175,3 @@ return this; | ||
addServer(server: oa.ServerObject): OpenApiBuilder { | ||
this.rootDoc.servers = this.rootDoc.servers || []; | ||
this.rootDoc.servers.push(server); | ||
@@ -162,2 +181,3 @@ return this; | ||
addTag(tag: oa.TagObject): OpenApiBuilder { | ||
this.rootDoc.tags = this.rootDoc.tags || []; | ||
this.rootDoc.tags.push(tag); | ||
@@ -164,0 +184,0 @@ return this; |
@@ -102,2 +102,3 @@ import * as yaml from 'yaml'; | ||
addPath(path: string, pathItem: oa.PathItemObject): OpenApiBuilder { | ||
this.rootDoc.paths = this.rootDoc.paths || []; | ||
this.rootDoc.paths[path] = { ...(this.rootDoc.paths[path] || {}), ...pathItem }; | ||
@@ -107,2 +108,4 @@ return this; | ||
addSchema(name: string, schema: oa.SchemaObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.schemas = this.rootDoc.components.schemas || {}; | ||
this.rootDoc.components.schemas[name] = schema; | ||
@@ -112,2 +115,4 @@ return this; | ||
addResponse(name: string, response: oa.ResponseObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.responses = this.rootDoc.components.responses || {}; | ||
this.rootDoc.components.responses[name] = response; | ||
@@ -117,2 +122,4 @@ return this; | ||
addParameter(name: string, parameter: oa.ParameterObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.parameters = this.rootDoc.components.parameters || {}; | ||
this.rootDoc.components.parameters[name] = parameter; | ||
@@ -122,2 +129,4 @@ return this; | ||
addExample(name: string, example: oa.ExampleObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.examples = this.rootDoc.components.examples || {}; | ||
this.rootDoc.components.examples[name] = example; | ||
@@ -130,2 +139,4 @@ return this; | ||
): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.requestBodies = this.rootDoc.components.requestBodies || {}; | ||
this.rootDoc.components.requestBodies[name] = reqBody; | ||
@@ -135,2 +146,4 @@ return this; | ||
addHeader(name: string, header: oa.HeaderObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.headers = this.rootDoc.components.headers || {}; | ||
this.rootDoc.components.headers[name] = header; | ||
@@ -143,2 +156,4 @@ return this; | ||
): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.securitySchemes = this.rootDoc.components.securitySchemes || {}; | ||
this.rootDoc.components.securitySchemes[name] = secScheme; | ||
@@ -148,2 +163,4 @@ return this; | ||
addLink(name: string, link: oa.LinkObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.links = this.rootDoc.components.links || {}; | ||
this.rootDoc.components.links[name] = link; | ||
@@ -153,2 +170,4 @@ return this; | ||
addCallback(name: string, callback: oa.CallbackObject | oa.ReferenceObject): OpenApiBuilder { | ||
this.rootDoc.components = this.rootDoc.components || {}; | ||
this.rootDoc.components.callbacks = this.rootDoc.components.callbacks || {}; | ||
this.rootDoc.components.callbacks[name] = callback; | ||
@@ -158,2 +177,3 @@ return this; | ||
addServer(server: oa.ServerObject): OpenApiBuilder { | ||
this.rootDoc.servers = this.rootDoc.servers || []; | ||
this.rootDoc.servers.push(server); | ||
@@ -163,2 +183,3 @@ return this; | ||
addTag(tag: oa.TagObject): OpenApiBuilder { | ||
this.rootDoc.tags = this.rootDoc.tags || []; | ||
this.rootDoc.tags.push(tag); | ||
@@ -165,0 +186,0 @@ return this; |
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { ISpecificationExtension, SpecificationExtension } from './specification-extension'; | ||
import { | ||
IExtensionName, | ||
ISpecificationExtension, | ||
SpecificationExtension | ||
} from './specification-extension'; | ||
@@ -21,3 +25,3 @@ export interface ServerObject extends ISpecificationExtension { | ||
if (SpecificationExtension.isValidExtension(extensionName)) { | ||
return obj[extensionName]; | ||
return obj[extensionName as IExtensionName]; | ||
} | ||
@@ -32,4 +36,4 @@ return undefined; | ||
if (obj && SpecificationExtension.isValidExtension(extensionName)) { | ||
obj[extensionName] = extension; | ||
obj[extensionName as IExtensionName] = extension; | ||
} | ||
} |
@@ -28,4 +28,4 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
} | ||
if (this[extensionName]) { | ||
return this[extensionName]; | ||
if (this[extensionName as IExtensionName]) { | ||
return this[extensionName as IExtensionName]; | ||
} | ||
@@ -40,3 +40,3 @@ return null; | ||
} | ||
this[extensionName] = payload; | ||
this[extensionName as IExtensionName] = payload; | ||
} | ||
@@ -43,0 +43,0 @@ listExtensions(): string[] { |
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"experimentalDecorators": true, | ||
"target": "ES2020", | ||
"outDir": "dist/mjs", | ||
"preserveConstEnums": true, | ||
"module": "ESNext", | ||
"moduleResolution": "Node16", | ||
"experimentalDecorators": true, | ||
"noImplicitAny": false, | ||
"noEmitHelpers": true, | ||
"noImplicitAny": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"removeComments": true, | ||
"preserveConstEnums": true, | ||
"noEmitHelpers": true, | ||
"skipLibCheck": true, | ||
"outDir": "dist/mjs", | ||
"strict": true, | ||
"sourceMap": true, | ||
"rootDir": "src", | ||
"types": ["vitest/globals", "node"] | ||
}, | ||
"buildOnSave": true, | ||
"compileOnSave": true, | ||
"buildOnSave": true, | ||
"exclude": ["**/*.spec.ts", "bin", "dist", "vite.config.ts", "node_modules/**"] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
207394
87
4590