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

SCHEMA: Update references to use _ref instead of $ref #1082

Closed

Conversation

effigies
Copy link
Collaborator

It looks like using $ref will cause issues with the MATLAB YAML reader (or maybe just MATLAB). I think _ref is very unlikely to hit collisions while being friendly to various languages.

@effigies effigies requested a review from tsalo as a code owner April 18, 2022 19:34
Copy link
Member

@tsalo tsalo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codecov
Copy link

codecov bot commented Apr 18, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.50%. Comparing base (ddab685) to head (4b88cae).

Additional details and impacted files
@@              Coverage Diff               @@
##           schema-sprint    #1082   +/-   ##
==============================================
  Coverage          71.50%   71.50%           
==============================================
  Files                  9        9           
  Lines                930      930           
==============================================
  Hits                 665      665           
  Misses               265      265           

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

@effigies effigies requested a review from Remi-Gau April 18, 2022 19:46
@effigies effigies added the schema Issues related to the YAML schema representation of the specification. Patch version release. label Apr 18, 2022
Copy link
Collaborator

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the TL;DR for here is:

  • JSON (YAML in this case) keys must start with a letter

It looks like using $ref will cause issues with the MATLAB YAML reader (or maybe just MATLAB). I think _ref is very unlikely to hit collisions while being friendly to various languages.

I hate to be that guy so let me bring in some self-deprecation into the mix...

Depends if you consider MATLAB a language...

MATLAB YAML reader

If only there was such a thing...

YAML pretty much has to be converted to JSON for MATLAB

AFAIK

_ref is very unlikely to hit collisions

Well loading a JSON that with such key in MATLAB will very likely lead to problems

Added a section in the starter kit because it may matter for some aspects of BIDS events file:
https://bids-standard.github.io/bids-starter-kit/folders_and_files/metadata.html#interoperability-issues

@effigies
Copy link
Collaborator Author

Maybe instead of this, we should write a schema2json tool that will take our YAML schema with references in it and produce a fully rendered schema with no references. If a conversion is already necessary, why implement dereferencing in another language?

@Remi-Gau
Copy link
Collaborator

Maybe instead of this, we should write a schema2json tool that will take our YAML schema with references in it and produce a fully rendered schema with no references. If a conversion is already necessary, why implement dereferencing in another language?

uuuuhhh I like that 👍

Also would make the fully rendered schema more explicit (albeit more verbose, no?) which could be good for new users.

@effigies
Copy link
Collaborator Author

Okay, let's discuss this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants