Make conversion process more robust

This commit is contained in:
Roman Hotsiy 2017-11-23 13:40:21 +02:00
parent 11387ede80
commit 86a7405ebf
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -18,7 +18,7 @@ export async function loadAndBundleSpec(specUrlOrObject: object | string): Promi
export function convertSwagger2OpenAPI(spec: any): Promise<OpenAPISpec> {
console.warn('[ReDoc Compatibility mode]: Converting OpenAPI 2.0 to OpenAPI 3.0');
return new Promise<OpenAPISpec>((resolve, reject) =>
convertObj(spec, {}, (err, res) => {
convertObj(spec, { patch: true, warnOnly: true }, (err, res) => {
// TODO: log any warnings
if (err) {
return reject(err);