oneOf not validating correctly?
See original GitHub issueThe oneOf
middleware appears to be validating incorrectly.
The below validates successfully
// body
{
"myField": true
}
// validation middleware
oneOf([check('myField').isString()])
This test case looks wrong, shouldn’t it be something other than isBoolean()
?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Failed validating 'oneOf' in schema · Issue #113 - GitHub
Hi, after updating to the latest release I had a strange error with schemas. Swagger example /couriers/{courierIdentifier}: get: ...
Read more >Issue with json schema oneOf validation ... Not able to get the ...
I need help in validating json object with following constraint. My object has four sub objects. ... Only one out of obj2, obj3,...
Read more >oneOf Validation Issue - Google Groups
I am working on creating a complex JSON schema and am having issues with validating a "oneOf" construction.
Read more >JSON Schema validation not handling nested "oneOf" properly
json that appear valid to my schema. I have attached a simplified example: oneOfTest. json is the schema, and oneOf-test. json is the...
Read more >oneOf, anyOf, allOf, not - Swagger
You can use it to validate the request body contains all the necessary information about the object to be updated, depending on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works as intended:
Right, I wasn’t using
validationResult
in my middleware 🤦