You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internal references are more easily and robustly handled using YAML anchors and aliases.
a: [1, 2, 3]ref_a: {$ref: "#a"}
can be implemented with an anchor and alias (without the need for a JSON pointer)
a: &id001 [1, 2, 3]ref_a: *id001
External references
Let's say we have have a file available as uri (where uri is some valid resolvable URI) that contains a (as above).
ref_a: {$ref: "uri#a"}
Note that there is no tag. This is a deviation from the typical annotation that ASDF uses to denote custom constructs (things that are not basic YAML).
Instead, an extension to the standard could implement an external reference (using it's own logic) via a tagged object:
ref_a !external_ref-1.0.0:
uri: uripath: a
Summary
Internal references can already be made using the YAML standard. External references can be implemented via a custom tag (which more closely matches how other custom objects are handled in ASDF).
I propose that we remove JSON pointer from the standard. This would mean that files written with the new standard (let's say 2.0.0) would not be able to produce external references unless we:
add a new tag to the standard
implement and extension that provides a tag for external references
I think either approach could work and if we decide that dropping JSON pointer is worthwhile can weight the pros and cons of each.
The text was updated successfully, but these errors were encountered:
The current standard includes internal and external references implemented using JSON pointers:
https://github.com/asdf-format/asdf-standard/blob/4f88f68abbb333f3b39207d63d89b3378644f729/docs/source/tree.rst#references
Internal references
Internal references are more easily and robustly handled using YAML anchors and aliases.
can be implemented with an anchor and alias (without the need for a JSON pointer)
External references
Let's say we have have a file available as
uri
(whereuri
is some valid resolvable URI) that containsa
(as above).Note that there is no tag. This is a deviation from the typical annotation that ASDF uses to denote custom constructs (things that are not basic YAML).
Instead, an extension to the standard could implement an external reference (using it's own logic) via a tagged object:
Summary
Internal references can already be made using the YAML standard. External references can be implemented via a custom tag (which more closely matches how other custom objects are handled in ASDF).
I propose that we remove JSON pointer from the standard. This would mean that files written with the new standard (let's say 2.0.0) would not be able to produce external references unless we:
I think either approach could work and if we decide that dropping JSON pointer is worthwhile can weight the pros and cons of each.
The text was updated successfully, but these errors were encountered: