Comments (5)
UPDATE: _d was not defined in the function, i defined it and now it works :)
Thanks for fixing my derp. I'll request a review on the PR.
from express-openapi-validator.
@tflolo - Do any of your security handlers depend on form values submitted as part of the multipart/form-data
request? From the OpenAPI schema you posted, it doesn't look this this would be the case, unless you removed those values before pasting here?
from express-openapi-validator.
@mdmower - None of my security handlers does anything other than check for a valid session. The code i posted is complete, and only thing i change between runs is the version of express-openapi-validator from 5.0.1 to 5.1.0. I can try to move multipartMiddlware after securityMiddleware in 5.0.1 and see if that works.
from express-openapi-validator.
@tflolo - Is there a chance that you recently updated your openapi schema to support multiple uploads via I was able to reproduce the same error as you, but the error I found also exists in version 5.0.5. To see if we're observing the same error, when version 5.1.0 is installed, could you temporarily update the following file and retest?oneOf
schema?
in node_modules/express-openapi-validator/dist/middlewares/openapi.request.validator.js
, replace old line 131:
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;
with new line:
const type = (_d = (_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) === null || _c === void 0 ? void 0 : _c[key]) === null || _d === void 0 ? void 0 : _d.type;
I've drafted PR #878 (which outputs the compiled JS above) but would like confirmation that it resolves the issue.
UPDATE: I just noticed that your report says you updated from 5.0.1 to 5.1.0, so this is starting to make sense. Support for nested JSON in multipart bodies was added in 5.0.2. See e5cb5d6 .
from express-openapi-validator.
@mdmower The error changed,
status: 500,
text: '{"message":"_d is not defined"}',
method: 'POST',
path: '/api/wave-log/upload'
I upgraded to 5.1.0 and copied the line 131 you posted
UPDATE: _d was not defined in the function, i defined it and now it works :)
from express-openapi-validator.
Related Issues (20)
- 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.
- 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
- readonly is ignored when properties are inherited through allOf
- Type coercion stops working if request validation is turned off HOT 1
- Support for the HyperExpress web framework HOT 1
- Multiple path params break support for URI path param HOT 1
- Upgrade or replace lodash
- Server variables without enum don't get validated
- Multiple specs are not supported HOT 1
- Found CVE-2021-23337 in latest version of express-openapi-validator HOT 1
- Request body is marked as invalid, using `oneOf` inside `allOf`
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.