express-openapi-validator
Advanced tools
Comparing version 5.3.4 to 5.3.5
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OpenApiSpecLoader = exports.sortRoutes = void 0; | ||
const util_1 = require("../middlewares/parsers/util"); | ||
const index_1 = require("./index"); | ||
@@ -42,9 +43,9 @@ // Sort routes by most specific to least specific i.e. static routes before dynamic | ||
} | ||
const pathParams = new Set(); | ||
const parameters = [...(_a = schema.parameters) !== null && _a !== void 0 ? _a : [], ...(_b = methods.parameters) !== null && _b !== void 0 ? _b : []]; | ||
for (const param of parameters) { | ||
if (param.in === 'path') { | ||
pathParams.add(param.name); | ||
} | ||
} | ||
const pathParams = [ | ||
...((_a = schema.parameters) !== null && _a !== void 0 ? _a : []), | ||
...((_b = methods.parameters) !== null && _b !== void 0 ? _b : []), | ||
] | ||
.map(param => (0, util_1.dereferenceParameter)(apiDoc, param)) | ||
.filter(param => param.in === 'path') | ||
.map(param => param.name); | ||
const openApiRoute = `${bp}${path}`; | ||
@@ -60,3 +61,3 @@ const expressRoute = `${openApiRoute}` | ||
method: method.toUpperCase(), | ||
pathParams: Array.from(pathParams), | ||
pathParams: Array.from(new Set(pathParams)), | ||
}); | ||
@@ -63,0 +64,0 @@ } |
{ | ||
"name": "express-openapi-validator", | ||
"version": "5.3.4", | ||
"version": "5.3.5", | ||
"description": "Automatically validate API requests and responses with OpenAPI 3 and Express.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -39,3 +39,3 @@ # ๐ฆ express-openapi-validator | ||
# experimental OAS 3.1 in alpha (contributions welcome - see branch `oas-3.1` and pr-882) | ||
npm install express-openapi-validator@6.0.0-alpha.1 | ||
npm install express-openapi-validator@6.0.0-alpha.2 | ||
``` | ||
@@ -42,0 +42,0 @@ |
Sorry, the diff of this file is not supported yet
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
368796
6260