@samchon/openapi
Advanced tools
Comparing version 0.1.2-dev.20240411-7 to 0.1.2-dev.20240411-8
@@ -6,7 +6,21 @@ "use strict"; | ||
(function (SwaggerV2Converter) { | ||
SwaggerV2Converter.convert = (input) => (Object.assign(Object.assign({}, input), { components: convertComponents(input), paths: input.paths | ||
SwaggerV2Converter.convert = (input) => ({ | ||
openapi: "3.1.0", | ||
info: input.info, | ||
components: convertComponents(input), | ||
paths: input.paths | ||
? Object.fromEntries(Object.entries(input.paths) | ||
.filter(([_, v]) => v !== undefined) | ||
.map(([key, value]) => [key, convertPathItem(input)(value)])) | ||
: undefined, openapi: "3.1.0" })); | ||
: undefined, | ||
servers: input.host | ||
? [ | ||
{ | ||
url: input.host, | ||
}, | ||
] | ||
: undefined, | ||
security: input.security, | ||
tags: input.tags, | ||
}); | ||
/* ----------------------------------------------------------- | ||
@@ -13,0 +27,0 @@ OPERATORS |
{ | ||
"name": "@samchon/openapi", | ||
"version": "0.1.2-dev.20240411-7", | ||
"version": "0.1.2-dev.20240411-8", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -6,3 +6,4 @@ import { OpenApi } from "../OpenApi"; | ||
export const convert = (input: SwaggerV2.IDocument): OpenApi.IDocument => ({ | ||
...input, | ||
openapi: "3.1.0", | ||
info: input.info, | ||
components: convertComponents(input), | ||
@@ -18,3 +19,11 @@ paths: input.paths | ||
: undefined, | ||
openapi: "3.1.0", | ||
servers: input.host | ||
? [ | ||
{ | ||
url: input.host, | ||
}, | ||
] | ||
: undefined, | ||
security: input.security, | ||
tags: input.tags, | ||
}); | ||
@@ -21,0 +30,0 @@ |
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
156457
4093