-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add schema validation for json data #167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good! jsonschema
has very nice functionalities.
The only comment I have is that three schema tests (for GENOME_BGC_MAPPINGS_SCHEMA, GENOME_STATUS_SCHEMA, and STRAIN_MAPPINGS_SCHEMA) have some redundancies (e.g., 'version' is a required property
, data_invalid_version
, ). We could think about a way to iter over the three schemas and reduce the number of files (and lines of code), but I am not sure if this is worth it, and it's not going to be easy. On one hand indeed, it's useful for a developer to have the three distinct files for testing the three schemas, it makes things very clear.
We should keep the tests on different schemas separate, in this way the tests are modular and clear, most importantly, it's easier to extend when schema changes. |
Fix #165.
Major changes:
src/nplinker/schemas
tests/schemas
load-validate
andvalidate-save
patterns