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

Validation error messages changed after upgrading jsonschema version from 3.2.0 to 4.21.1 #1233

Closed
saksham99del opened this issue Mar 12, 2024 · 5 comments
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup

Comments

@saksham99del
Copy link

I recently updated my jsonschema version from 3.2.0 to latest one 4.21.1.Since upgrading the version my error messages are changed and i am not able to fix it.

Example Json :
{ "example":
{ "key":"value"}
}
If i change the value of key to key1.I used to get the error message " "key" is a required property " in the earlier version and now after upgrading I am getting the message that prints whole block instead of the affected key like
" "{ "key1":"value"}" doesn't fulfill the required schema".Is there any way to still get the old message back while still using the latest version.

@Julian
Copy link
Member

Julian commented Mar 12, 2024

" "{ "key1":"value"}" doesn't fulfill the required schema

I'm assuming you're paraphrasing as this isn't a message this library would produce.

No, and error messages are explicitly not part of jsonschema's API.

If this is for testing, you shouldn't test against messages.

Otherwise you might be interested in #1218

@Julian Julian closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@Julian Julian added the Invalid Not a bug, PEBKAC, or an unsupported setup label Mar 12, 2024
@saksham99del
Copy link
Author

Apologies The exact message produced by Library is :
" { 'key1':'value'} is not valid under any of the given schemas" and this change in message is applicable from version 4.8.0 .

@tanvn
Copy link

tanvn commented Mar 15, 2024

I think I have faced the same issue, the previous version provides more informative error messages.

@saksham99del
Copy link
Author

How did you mitigate the issue?

@tanvn
Copy link

tanvn commented Mar 15, 2024

Ah I just did not upgrade to 4.21.1, we are just using 4.17.x (IIRC 4.18.x also works)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invalid Not a bug, PEBKAC, or an unsupported setup
Projects
None yet
Development

No branches or pull requests

3 participants