Skip to content
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

Poor error message when unevaluatedProperties is a schema #996

Closed
Julian opened this issue Sep 1, 2022 · 0 comments
Closed

Poor error message when unevaluatedProperties is a schema #996

Julian opened this issue Sep 1, 2022 · 0 comments
Labels
Bug Something doesn't work the way it should. Error Reporting Issues related to clearer or more robust validation error reporting

Comments

@Julian
Copy link
Member

Julian commented Sep 1, 2022

from jsonschema.validators import validator_for

schema = {"unevaluatedProperties": {"const": 12}}
print(next(validator_for(schema)(schema).iter_errors({"type": 37})))

produces the misleading:

Unevaluated properties are not allowed ('type' was unexpected)

Failed validating 'unevaluatedProperties' in schema:
    {'unevaluatedProperties': {'const': 12}}

On instance:
    {'type': 37}
@Julian Julian added Bug Something doesn't work the way it should. Error Reporting Issues related to clearer or more robust validation error reporting labels Sep 1, 2022
@Julian Julian closed this as completed in 7830605 Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something doesn't work the way it should. Error Reporting Issues related to clearer or more robust validation error reporting
Projects
None yet
Development

No branches or pull requests

1 participant