-
-
Notifications
You must be signed in to change notification settings - Fork 589
error path is missing when using iter_errors #411
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
Comments
This is currently failing due to python-jsonschema/jsonschema#411
This is expected, though maybe underdocumented. path means "where in the instance the error occured", and should always be a sequence of indexes that can be performed against the instance.
Try your example with any other validator, or any nested object. |
Hm, that is problematic for me. My use case here is doing validation on data past to a REST service, and I would like to report all errors back to the client, which I can't do now due to the missing path. As far as I can see there is no other way to see which property triggered the error. This is the
Can you consider adding some way to see which property triggered the error? |
You're already seeing every error. If you mean you want to know specifically for |
I'll see if I can take a stab at that. One thing that has me a little confused is that the behaviour is not consistent: when using |
@wichert you might be interested in the discussion in json-schema-org/json-schema-spec#396, about standardizing or at least recommending output/error formats. Note that that's on the spec repo, not this implementation. It's also just getting off the ground despite having been filed a while back. |
What code are you running and what path are you looking at? The behavior here should match between |
Going to close this given the above (but if you do have a case where this has different behavior definitely lemme know!) and given @handrews's pointer, which I'll have to have a look at myself. |
ea41553 Remove test that doesn't match RFC 3339 duration grammar dee8ef7 Merge pull request #411 from ChALkeR/chalker/more-unevaluted cd88fb5 Add more nested and cousin unevaluatedProperties tests 5f3dc7e Merge pull request #415 from json-schema-org/ether/more-ipv6-tests 04ddab1 some more ipv6 tests acb45cd Merge pull request #417 from ChALkeR/chalker/patternProperties 0f4b73a One more patternProperties test with boolean schemas 8ccbfdc Merge pull request #412 from json-schema-org/ether/more-format-duration-2 1329dab some more tests for the "duration" format 1d5c3c0 Merge pull request #405 from ChALkeR/chalker/email-format 7ad7443 Extend email format tests git-subtree-dir: json git-subtree-split: ea415537dda2613f3cd5df1f219f84086f75a7dc
I have a very basic schema:
When I validate an empty map against that I can see two errors:
Creating an error tree fails shows some odd behaviour:
Trying to figure out why this happened revealed that the error path is empty:
The text was updated successfully, but these errors were encountered: