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

Resolve JSON references that point to things in-tree automatically #1840

Open
Cadair opened this issue Sep 26, 2024 · 4 comments
Open

Resolve JSON references that point to things in-tree automatically #1840

Cadair opened this issue Sep 26, 2024 · 4 comments

Comments

@Cadair
Copy link
Contributor

Cadair commented Sep 26, 2024

The standard says:

The YAML 1.1 standard itself also provides a method for internal references called “anchors” and “aliases”. It does not, however, support external references. While ASDF does not explicitly disallow YAML anchors and aliases, since it explicitly supports all of YAML 1.1, their use is discouraged in favor of the more flexible JSON Pointer/JSON Reference standard described above.

however, the Python library makes this pretty hard to follow. If you use JSON References then they will not be resolved automatically making their use in things which get passed to a Converter class pretty troublesome. It would be good if in-tree references were automatically resolved and then it would be transparent to the converter.

cc @seanhess

@braingram
Copy link
Contributor

Can you use an anchor and alias? These are automatically resolved.

@seanhess
Copy link

seanhess commented Sep 26, 2024

Hey there, yeah the plan is to switch to use anchors instead. How closely tied is the asdf python library to the standard? If references aren't fully supported by the python lib (which I imagine is by far the most used) it might make sense to change that paragraph in the standard docs, and encourage reference use only for external references?

@braingram
Copy link
Contributor

Thanks!

At the moment the python library and standard are pretty tied together (since the python library is the most complete implementation of the standard).

I'm surprised to see the standard discourage anchors and aliases. I opened a PR to remove that statement.

@seanhess
Copy link

Sounds good, thanks!

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

No branches or pull requests

3 participants