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

Schemas should be checked against merged dictionaries instead of individual JSON files #438

Closed
chrisgorgo opened this issue Mar 14, 2018 · 1 comment · Fixed by #514 or bids-standard/bids-specification#802

Comments

@chrisgorgo
Copy link
Contributor

See https://github.com/INCF/bids-validator/pull/301#issuecomment-337293516 for context.

BIDS allows key/value pairs shared among many different JSON files to be stored in single location higher in the directory tree. This is called the Inheritance Principle and is described in section 3.5 of the spec (http://bids.neuroimaging.io/bids_spec1.0.2.pdf).

Currently validator relies on JSON schemas to check validity of JSON files. However, those schemas are checked against individual files instead of merged dictionaries across the hierarchy. This needs to be fixed.

Schemas are validated here: https://github.com/INCF/bids-validator/blob/master/validators/json.js#L34.

It's worth mentioning that merging JSON files across hierarchies is already implemented: https://github.com/INCF/bids-validator/blob/37924a136d9831256bd0eb47606a9b2031cc523e/validators/nii.js#L39

@chrisgorgo
Copy link
Contributor Author

It's worth noting that right now each JSON file is checked individually and the schemas do not include information about which fields are required. Those checks are done manually in code after the dictionaries are merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants