-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: null test missing for missing discriminator property. #985
Comments
Thanks for raising the issue. I think the simple fix is to have it fall back on json-schema-validator/src/main/java/com/networknt/schema/OneOfValidator.java Lines 141 to 149 in eea61d6
I don't really have an objection to a specific error message for the missing property, since the spec states But if you want to do so then ideally the PR should have a proper fix, meaning that
|
After looking at this closer it looks like due to the following To make the behavior consistent with the rest of the usages the logic needs to treat the discriminator as matching if the property is not present in the data and rely on the I shall probably create the PR to resolve this. |
Where:
json-schema-validator/src/main/java/com/networknt/schema/OneOfValidator.java
Line 113 in eea61d6
To trigger:
schema:
value:
I want to try to make a PR, what should be the expected behavior in this case. Ideas:
1 - returning an error similar to the missing required property, but specifying that it is the discriminator.
2 - ignoring discriminator and return all errors
The text was updated successfully, but these errors were encountered: