YAML2 icon indicating copy to clipboard operation
YAML2 copied to clipboard

Hyperlinks

Open trans opened this issue 13 years ago • 1 comments

YAML already supports an internal link notation.

defaults: &defaults
  correspondence_address:
    street: '100 W Hubbard'
    city: 'New York'
    state: NY
development:
  <<: &defaults
  billing_address:
    street: '100 W Hubbard'
  ...

Could YAML support external links as well? Either or both, local files:

development:
  <<: &./foo.yaml/defaults
  billing_address:
    street: '100 W Hubbard'
  ...

And over the wire:

development:
  <<: &http://foo.org/foo.yaml/defaults
  billing_address:
    street: '100 W Hubbard'
  ...

trans avatar Nov 26 '12 12:11 trans

Native links don't survive round-trip YAML parsing (i.e. read YAML, interprete YAML, dump YAML) because they get replaced by the content they point to. I would prefer to see all kind of links dropped (including internal references) and string being the only supported data type. This is one of the many improvements made in StrictYAML (see #8). Note that non-string data types (including links) can still be supported as part of a schema.

If links are natively supported, with content returned by default, then there needs to be a mechanism to query whether an object is a link and to return the link text instead, like with filesystem symlinks.

shoogle avatar Jul 06 '19 17:07 shoogle