New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

express-zod-openapi

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-zod-openapi - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

7

CHANGELOG.md

@@ -70,1 +70,8 @@ ### 0.0.1 (2022-03-04)

## [0.0.11](https://github.com/MunifTanjim/express-zod-openapi/compare/0.0.10...0.0.11) (2023-10-16)
### Bug Fixes
* validate response before stringification ([20fb1e8](https://github.com/MunifTanjim/express-zod-openapi/commit/20fb1e8a3f158f1ce8cb47a5fcc33283548d8600))

12

lib/index.js

@@ -436,10 +436,8 @@ var zodToJsonSchema = require('zod-to-json-schema');

function setupResponseValidation(res, spec, segmentOrder, next) {
const originalSend = res.send;
const originalJson = res.json;
res.send = function validateAndSendResponse(...args) {
res.send = originalSend;
const body = args[0];
const isJsonContent = /application\/json/.test(String(res.get('content-type')));
res.json = function validateAndSendJsonResponse(...args) {
res.json = originalJson;
const value = {
body: isJsonContent ? JSON.parse(body) : body,
body: args[0],
headers: res.getHeaders()

@@ -473,3 +471,3 @@ };

return originalSend.apply(res, [isJsonContent ? JSON.stringify(value.body) : value.body]);
return res.json(value.body);
};

@@ -476,0 +474,0 @@ }

@@ -436,10 +436,8 @@ import { zodToJsonSchema } from 'zod-to-json-schema';

function setupResponseValidation(res, spec, segmentOrder, next) {
const originalSend = res.send;
const originalJson = res.json;
res.send = function validateAndSendResponse(...args) {
res.send = originalSend;
const body = args[0];
const isJsonContent = /application\/json/.test(String(res.get('content-type')));
res.json = function validateAndSendJsonResponse(...args) {
res.json = originalJson;
const value = {
body: isJsonContent ? JSON.parse(body) : body,
body: args[0],
headers: res.getHeaders()

@@ -473,3 +471,3 @@ };

return originalSend.apply(res, [isJsonContent ? JSON.stringify(value.body) : value.body]);
return res.json(value.body);
};

@@ -476,0 +474,0 @@ }

{
"name": "express-zod-openapi",
"version": "0.0.10",
"version": "0.0.11",
"description": "Express Zod OpenAPI",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

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