swagger2openapi
Advanced tools
Comparing version 2.12.0-1 to 2.12.0-2
@@ -207,8 +207,11 @@ // @ts-check | ||
let newRef = '#/components/'+type+'/'+prefix+suffix; | ||
let refSuffix = ''; | ||
if (type === 'examples') { | ||
target = { value: target }; | ||
newRef += '/value'; | ||
refSuffix = '/value'; | ||
} | ||
jptr.jptr(options.openapi,newRef,target); | ||
obj[key] = newRef; | ||
obj[key] = newRef+refSuffix; | ||
} | ||
@@ -215,0 +218,0 @@ } |
{ | ||
"name": "swagger2openapi", | ||
"version": "2.12.0-1", | ||
"version": "2.12.0-2", | ||
"description": "Convert Swagger 2.0 definitions to OpenApi 3.0 and validate", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -112,5 +112,8 @@ # swagger2openapi | ||
### Regression tests | ||
Regression tests (thanks @domharrington) live in the `/test` directory and can be run with `npx mocha`. Each sub-directory should contain an input `swagger.yaml` file, an expected output `openapi.yaml` file and an optional `options.yaml` file. You can put private test cases in sub-directories starting with an underscore character. | ||
## License | ||
[BSD-3-Clause](LICENSE) except the `openapi-3.0.json` schema, which is taken from the [OpenAPI-Specification](https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v3.0/schema.json) and the alternative `gnostic-3.0.json` schema, which is originally from [Google Gnostic](https://github.com/googleapis/gnostic/blob/master/OpenAPIv3/openapi-3.0.json). Both of these are licensed under the [Apache-2](http://www.apache.org/licenses/LICENSE-2.0) license. | ||
[BSD-3-Clause](LICENSE) except the `openapi-3.0.json` schema, which is taken from the [OpenAPI-Specification](https://github.com/OAI/OpenAPI-Specification/blob/49e784d7b7800da8732103aa3ac56bc7ccde5cfb/schemas/v3.0/schema.yaml) and the alternative `gnostic-3.0.json` schema, which is originally from [Google Gnostic](https://github.com/googleapis/gnostic/blob/master/OpenAPIv3/openapi-3.0.json). Both of these are licensed under the [Apache-2](http://www.apache.org/licenses/LICENSE-2.0) license. |
@@ -207,2 +207,6 @@ #!/usr/bin/env node | ||
if ((options.source.indexOf('!')>=0) && (options.source.indexOf('swagger.')>=0)) { | ||
expectFailure = true; | ||
} | ||
if (file.startsWith('http')) { | ||
@@ -209,0 +213,0 @@ swagger2openapi.convertUrl(file, common.clone(options)) |
@@ -637,3 +637,3 @@ // @ts-check | ||
let pathParameters = {}; | ||
if (typeof pathItem.parameters !== 'undefined') pathItem.parameters.should.be.an.Array(); | ||
if (typeof pathItem.parameters !== 'undefined') should(pathItem.parameters).be.an.Array(); | ||
for (let p in pathItem.parameters) { | ||
@@ -640,0 +640,0 @@ contextAppend(options, 'parameters'); |
Sorry, the diff of this file is not supported yet
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
303600
6830
119