jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 58 forks source link

all of allOf, anyOf, oneOf can exist together in a schema #196

Closed karenetheridge closed 4 years ago

karenetheridge commented 4 years ago

I noticed that the _validate sub skips anyOf and oneOf rules if allOf was present. But nowhere in the spec does it say that these can't appear together. We should run them all and collect all the errors, even if it's nonsensical to combine the rules.

references: https://json-schema.org/understanding-json-schema/reference/combining.html https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7

karenetheridge commented 4 years ago

(fixed in a branch, not yet PR'd.)