oas-normalize
Advanced tools
Comparing version 8.1.1 to 8.1.2
import type { OpenAPI } from 'openapi-types'; | ||
import openapiParser from '@readme/openapi-parser'; | ||
import * as utils from './lib/utils'; | ||
@@ -114,2 +115,3 @@ export declare type Options = { | ||
convertToLatest?: boolean; | ||
parser?: openapiParser.Options; | ||
}): Promise<any>; | ||
@@ -116,0 +118,0 @@ /** |
@@ -204,7 +204,11 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var convertToLatest, colorizeErrors; | ||
var convertToLatest, parserOptions; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
convertToLatest = opts.convertToLatest; | ||
colorizeErrors = this.opts.colorizeErrors; | ||
parserOptions = opts.parser || {}; | ||
if (!parserOptions.validate) { | ||
parserOptions.validate = {}; | ||
} | ||
parserOptions.validate.colorizeErrors = this.opts.colorizeErrors; | ||
return [2 /*return*/, this.load() | ||
@@ -233,7 +237,3 @@ .then(function (schema) { return __awaiter(_this, void 0, void 0, function () { | ||
return [2 /*return*/, openapi_parser_1["default"] | ||
.validate(clonedSchema, { | ||
validate: { | ||
colorizeErrors: colorizeErrors | ||
} | ||
}) | ||
.validate(clonedSchema, parserOptions) | ||
.then(function () { | ||
@@ -240,0 +240,0 @@ if (!convertToLatest) { |
{ | ||
"name": "oas-normalize", | ||
"version": "8.1.1", | ||
"version": "8.1.2", | ||
"description": "Tooling for converting, valiating, and parsing OpenAPI, Swagger, and Postman API definitions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -150,7 +150,13 @@ import type { OpenAPI } from 'openapi-types'; | ||
convertToLatest?: boolean; | ||
parser?: openapiParser.Options; | ||
} = { convertToLatest: false } | ||
) { | ||
const convertToLatest = opts.convertToLatest; | ||
const colorizeErrors = this.opts.colorizeErrors; | ||
const parserOptions = opts.parser || {}; | ||
if (!parserOptions.validate) { | ||
parserOptions.validate = {}; | ||
} | ||
parserOptions.validate.colorizeErrors = this.opts.colorizeErrors; | ||
return this.load() | ||
@@ -184,7 +190,3 @@ .then(async schema => { | ||
return openapiParser | ||
.validate(clonedSchema, { | ||
validate: { | ||
colorizeErrors, | ||
}, | ||
}) | ||
.validate(clonedSchema, parserOptions) | ||
.then(() => { | ||
@@ -191,0 +193,0 @@ if (!convertToLatest) { |
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
2664627
898