You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// run `node index.js` in the terminalconstSwaggerParser=require('@apidevtools/swagger-parser');constOpenAPIRequestValidator=require('openapi-request-validator');console.log(`Hello Node.js v${process.versions.node}!`);(async()=>{letapi=awaitSwaggerParser.bundle('./my-api.yml');constvalidator=newOpenAPIRequestValidator.default({
...api.paths['/test'].get,});constvalidation=validator.validateRequest({body: {},headers: {'x-my-header': 'test1'},query: {filter: '{"type": "test"}'},});console.log('\n\nshould contains a validation error about query',validation);})();
I should have some errors color is required (and have pattern to respect). Is there anything I am doing wrong?
The text was updated successfully, but these errors were encountered:
Hello,
I have an issue regarding the request validator. It doesn't seem to validate objects (content > application/json) given in header or query params.
Stackblitz to reproduce : https://stackblitz.com/edit/node-bfjjnw?embed=1&file=index.js,my-api.yml
Calling the validator
I should have some errors
color
is required (and have pattern to respect). Is there anything I am doing wrong?The text was updated successfully, but these errors were encountered: