Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

express-openapi-validator

Package Overview
Dependencies
Maintainers
1
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-openapi-validator - npm Package Compare versions

Comparing version 5.3.4 to 5.3.5

17

dist/framework/openapi.spec.loader.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc