Skip to content

Expose failed property name in required_draft4? #344

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

Closed
pobiega opened this issue Jul 6, 2017 · 2 comments
Closed

Expose failed property name in required_draft4? #344

pobiega opened this issue Jul 6, 2017 · 2 comments

Comments

@pobiega
Copy link

pobiega commented Jul 6, 2017

https://github.com/Julian/jsonschema/blob/master/jsonschema/_validators.py#L314

It would be very useful to expose the property that failed, other than in the message. Adding a ValidationError.property property that defaults to None and filling it before yielding works and is what I'm currently doing locally.

@Julian
Copy link
Member

Julian commented Jul 6, 2017

Hi!

See #119, which is still waiting for a patch :)

@Julian Julian closed this as completed Jul 6, 2017
@pampas93
Copy link

You could add the "required" field into your schema; and once you validate; you know which properties are missing.
Worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants