Comments (6)
@SpencerLawrenceBrown thanks for the issue.
which version of express-openapi-validator are you using?
from express-openapi-validator.
2.3.0
from express-openapi-validator.
it seems to be related to how
try {
fn(json, req, res)
} catch ...
is compiled to js. When its compiled it becomes:
try {
fn(json, req, res)
.then(json => {
if (res.headersSent)
return;
// If null, then 204 No Content
if (json === null)
return res.status(204).end();
// If munged scalar value, then text/plain
if (json !== originalJson && isScalar(json)) {
res.set('content-type', 'text/plain');
return res.send(String(json));
}
return original.call(this, json);
})
.catch(e => mung.onError(e, req, res, next));
}
from express-openapi-validator.
^^ in modded.express.mung
from express-openapi-validator.
I just downgraded to 2.1.5 and it works fine. Looks like a change between 2.1.5 and 2.3.0
from express-openapi-validator.
Thanks @SpencerLawrenceBrown. I spotted the issue. It should be resolved in v2.3.1.
from express-openapi-validator.
Related Issues (20)
- Warning Mode
- Response validation incorrectly fails for `undefined` values for additionalProperties
- format: date accepts incorrect month range HOT 1
- Add support to multiple specs on the same routes
- Invalid example for NestJS. Looks like response validation is broken. HOT 2
- Type error when passing an object to apiSpec (TypeScript) HOT 1
- Request Body content-types don't consider custom parameters
- How to specify middleware handler for single endpoint HOT 1
- multipartMiddleware preceeds securityMiddleware so files begin uploading before security check HOT 3
- Security handlers cannot access request params
- The validation doesn't work at all HOT 2
- Question: should serdes.serialize be called when validateResponse=false
- Serdes Does Not Work for Items in Request Parameters in Array HOT 1
- HTTP HEAD not implemented for HTTP GET similar to ExpressJS v4.
- Multer worked on 5.0.1 throws internal server error in 5.1.0 HOT 5
- Introduction of multiple swagger docs with new endpoint now versioned returns 404 HOT 2
- the same oneOf schema can pass request validation. But cannot pass response validation
- version 5.1.1, apiKey cookie authentication results in error HOT 1
- Email format validation does not accept non-ascii characters
- Multiple spec support breaks if validateResponses: true HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-openapi-validator.