import swagger2openapi from 'swagger2openapi';
export function convertSwagger2OpenAPI(spec) {
    if (!spec.paths) {
        spec.paths = {};
    }
    return new Promise((resolve, reject) => swagger2openapi.convertObj(spec, { patch: true, warnOnly: true, text: '{}', anchors: true }, (err, res) => {
        // TODO: log any warnings
        if (err) {
            return reject(err);
        }
        resolve(res?.openapi);
    }));
}
//# sourceMappingURL=convertSwagger2OpenAPI.js.map