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

rf(metaschema): Validate object definitions that are JSON schema #1869

Merged
merged 7 commits into from
Jul 18, 2024

Conversation

effigies
Copy link
Collaborator

schema.objects.metadata entries are very nearly JSON schema definitions. To allow BIDS validators to stand on the shoulders of JSON schema validators, the goal of this PR is to define them as JSON schema with extra fields. By doing so, BIDS validators can pass these directly to JSON schema validators along with the pieces of JSON objects that they are intended to validate.

In order to do this, I've tried to formalize the different "kinds" of objects (or terms) we have in composable classes.

The main change to the schema is to rename required_fields to required, which has the same meaning in JSON schema. Similarly, we update recommended_fields to recommended, although this will have no impact on validation for now.

Copy link

codecov bot commented Jul 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.04%. Comparing base (6beec13) to head (e78af92).
Report is 292 commits behind head on master.

Files with missing lines Patch % Lines
tools/schemacode/bidsschematools/render/tables.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1869   +/-   ##
=======================================
  Coverage   88.04%   88.04%           
=======================================
  Files          16       16           
  Lines        1380     1380           
=======================================
  Hits         1215     1215           
  Misses        165      165           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies effigies force-pushed the schema/json-schema-ify branch from 376ac03 to 6c257f9 Compare July 15, 2024 17:10
@effigies effigies requested review from bendichter and rwblair and removed request for erdalkaraca and tsalo July 15, 2024 17:34
@effigies
Copy link
Collaborator Author

Validating objects.metadata as JSON-schema+ objects finds no failures. @rwblair This should be relatively straightforward to review, but LMK if you want to go over anything live.

I've got some more stuff that does catch bugs in the schema that I want to patch in after this is in.

src/metaschema.json Show resolved Hide resolved
src/metaschema.json Show resolved Hide resolved
src/metaschema.json Show resolved Hide resolved
@effigies effigies merged commit 1418ce8 into bids-standard:master Jul 18, 2024
26 of 27 checks passed
@effigies effigies deleted the schema/json-schema-ify branch July 18, 2024 19:28
@effigies effigies added schema Issues related to the YAML schema representation of the specification. Patch version release. exclude-from-changelog This item will not feature in the automatically generated changelog labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-from-changelog This item will not feature in the automatically generated changelog schema Issues related to the YAML schema representation of the specification. Patch version release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants