import { SwaggerJson } from "../types" ; import converter from "swagger2openapi" ; /** Support swagger v2 */ function swaggerToOpenApi ( input ) { const options = { } ; options . patch = true ; options . warnOnly = true ; return new Promise < SwaggerJson > ( ( resolve , reject ) => { converter . convertObj ( input , options , function ( err , result ) { if ( err ) { reject ( err ) ; return ; } resolve ( result . openapi ) ; } ) ; } ) ; } export { swaggerToOpenApi } ;