-
Notifications
You must be signed in to change notification settings - Fork 325
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
More consistent path for ValidationMessage? #615
Comments
@ppazos Thanks a lot for pointing it out. Different validators are mixed together to form a tree structure, and sometimes, the path for the error message is confusing due to the parent and child relationship. As the error message is constructed in each validator, we can fix it once the issue is identified. We do have some issues that are not resolvable as the children's path is not available for some of the validators, but the cases are limited. |
Thanks @stevehu ! The one that I have identified for now is just the I'm still verifying different types of errors on my library, if I found other errors with paths that I wouldn't expect, I'll report back. Thanks again for your kind message. |
There is a related issue that is resolved at #687 |
I'm using 1.0.73 and doing some unit tests with JSON validation.
For the
$.xxxx: is missing but it is required
kind of error, the ValidationMessage.path is$
For the
$.x.y: integer found, string expected
kind of error, the ValidationMessage.path is$.x.y
Shouldn't the path for the
is missing but it is required
error be$.xxxx
, which is the missing key instead of$
which is the parent object?In unit tests when that kind of error is expected, but there are other ValidationMessage in the error set, it's difficult to find the error expected at a certain path since the returned path is for the parent, not for where the value is required and missing.
I need to test other cases to know if there is any other difference with the paths there.
Thanks.
The text was updated successfully, but these errors were encountered: