oas-normalize
Advanced tools
Comparing version 8.1.2 to 8.1.3
@@ -25,2 +25,6 @@ import type { OpenAPI } from 'openapi-types'; | ||
/** | ||
* @private | ||
*/ | ||
static convertPostmanToOpenAPI(schema: any): Promise<any>; | ||
/** | ||
* Bundle up the given API definition, resolving any external `$ref` pointers in the process. | ||
@@ -27,0 +31,0 @@ * |
@@ -142,2 +142,8 @@ "use strict"; | ||
/** | ||
* @private | ||
*/ | ||
OASNormalize.convertPostmanToOpenAPI = function (schema) { | ||
return (0, postman_to_openapi_1["default"])(JSON.stringify(schema), null, { outputFormat: 'json', replaceVars: true }).then(JSON.parse); | ||
}; | ||
/** | ||
* Bundle up the given API definition, resolving any external `$ref` pointers in the process. | ||
@@ -158,3 +164,3 @@ * | ||
if (utils.isPostman(schema)) { | ||
return (0, postman_to_openapi_1["default"])(JSON.stringify(schema), null, { outputFormat: 'json' }).then(JSON.parse); | ||
return OASNormalize.convertPostmanToOpenAPI(schema); | ||
} | ||
@@ -187,3 +193,3 @@ return schema; | ||
if (utils.isPostman(schema)) { | ||
return (0, postman_to_openapi_1["default"])(JSON.stringify(schema), null, { outputFormat: 'json' }).then(JSON.parse); | ||
return OASNormalize.convertPostmanToOpenAPI(schema); | ||
} | ||
@@ -222,3 +228,3 @@ return schema; | ||
} | ||
return [2 /*return*/, (0, postman_to_openapi_1["default"])(JSON.stringify(schema), null, { outputFormat: 'json' }).then(JSON.parse)]; | ||
return [2 /*return*/, OASNormalize.convertPostmanToOpenAPI(schema)]; | ||
}); | ||
@@ -225,0 +231,0 @@ }); }) |
{ | ||
"name": "oas-normalize", | ||
"version": "8.1.2", | ||
"version": "8.1.3", | ||
"description": "Tooling for converting, valiating, and parsing OpenAPI, Swagger, and Postman API definitions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -91,2 +91,9 @@ import type { OpenAPI } from 'openapi-types'; | ||
/** | ||
* @private | ||
*/ | ||
static convertPostmanToOpenAPI(schema: any) { | ||
return postmanToOpenAPI(JSON.stringify(schema), null, { outputFormat: 'json', replaceVars: true }).then(JSON.parse); | ||
} | ||
/** | ||
* Bundle up the given API definition, resolving any external `$ref` pointers in the process. | ||
@@ -104,3 +111,3 @@ * | ||
if (utils.isPostman(schema)) { | ||
return postmanToOpenAPI(JSON.stringify(schema), null, { outputFormat: 'json' }).then(JSON.parse); | ||
return OASNormalize.convertPostmanToOpenAPI(schema); | ||
} | ||
@@ -130,3 +137,3 @@ | ||
if (utils.isPostman(schema)) { | ||
return postmanToOpenAPI(JSON.stringify(schema), null, { outputFormat: 'json' }).then(JSON.parse); | ||
return OASNormalize.convertPostmanToOpenAPI(schema); | ||
} | ||
@@ -170,3 +177,3 @@ | ||
return postmanToOpenAPI(JSON.stringify(schema), null, { outputFormat: 'json' }).then(JSON.parse); | ||
return OASNormalize.convertPostmanToOpenAPI(schema); | ||
}) | ||
@@ -173,0 +180,0 @@ .then(async schema => { |
2664839
914