-
Notifications
You must be signed in to change notification settings - Fork 8
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
Print out key giving ValidationError #28
Comments
Pasting the above into one of the test files and stepping through, it looks like the
So perhaps we could just add the contents of the path, separated by colons or slashes, to the 'in' part of the message, e.g.
For an invalid keyword this could look something like:
(2 is the index of the item in the list - would we want to modify indices to make them easier to read?) |
Yes, that looks good. A simpler approach might be just to use the string representation (source code) of the
For an invalid
|
Draft PR in #31. Sample error messages: Using a number instead of a string for
Missing license info:
Invalid cmenergies value (this had to be fudged slightly as it doesn't come directly from the schema):
Do these look OK? |
The jsonschema package only prints out the value giving a
ValidationError
, not the associated key. This is often not informative, for example, if the value isNone
:arising from a
submission.yaml
file containing:This line was originally written by default when converting from the
oldhepdata
format (see HEPData/hepdata-converter#32), therefore many old submissions are now invalidated. The key giving rise to aValidationError
should be printed in addition to the invalid value. See Handling Validation Errors in thejsonschema
docs.The text was updated successfully, but these errors were encountered: