Closed dpoeira91 closed 9 months ago
Hi Diogo.
Thank you for reporting this issue. I can verify that this is a bug within json-schema-library allOf validation.
This issue has been fixed and is published with json-schema-library@9.1.1
.
Can you verify that your issue has been resolved?
Just tested this out with the new version, seems to be working for my use-case. Thank you very much! 🙌
Thank you for your feedback!
When validating an object against a JSON schema that uses conditional constraints, the library appears to be incorrectly flagging valid combinations as invalid.
Example Schema:
Object to validate:
Based on the provided schema, the object should be valid:
animal_species
is "cat", so thediet_type
can be either "carnivore" or "omnivore".diet_type
is "omnivore" andanimal_species
is "cat",habitat_type
should be "mountain".However, when validating the object against the schema using the
json-schema-library
, an error is thrown indicating thatdiet_type
must be "carnivore". This is contrary to the schema's specifications and seems to indicate an issue in how the library handles the conditional constraints.Would appreciate any assistance in resolving this. Thank you!