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.0.1 to 5.0.2

1

dist/middlewares/openapi.request.validator.d.ts

@@ -13,4 +13,5 @@ import { NextFunction, Response } from 'express';

private buildMiddleware;
private multipartNested;
private discriminatorValidator;
private processQueryParam;
}

@@ -98,2 +98,5 @@ "use strict";

const schemaBody = validator === null || validator === void 0 ? void 0 : validator.schemaBody;
if (contentType.mediaType === 'multipart/form-data') {
this.multipartNested(req, schemaBody);
}
const discriminator = (_d = (_c = schemaBody === null || schemaBody === void 0 ? void 0 : schemaBody.properties) === null || _c === void 0 ? void 0 : _c.body) === null || _d === void 0 ? void 0 : _d._discriminator;

@@ -122,2 +125,18 @@ const discriminatorValidator = this.discriminatorValidator(req, discriminator);

}
multipartNested(req, schemaBody) {
Object.keys(req.body).forEach((key) => {
var _a, _b, _c;
const value = req.body[key];
const type = (_c = (_b = (_a = schemaBody === null || schemaBody === void 0 ? void 0 : schemaBody.properties) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.properties[key]) === null || _c === void 0 ? void 0 : _c.type;
if (['array', 'object'].includes(type)) {
try {
req.body[key] = JSON.parse(value);
}
catch (e) {
// NOOP
}
}
});
return null;
}
discriminatorValidator(req, discriminator) {

@@ -124,0 +143,0 @@ if (discriminator) {

2

package.json
{
"name": "express-openapi-validator",
"version": "5.0.1",
"version": "5.0.2",
"description": "Automatically validate API requests and responses with OpenAPI 3 and Express.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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