yamlinc icon indicating copy to clipboard operation
yamlinc copied to clipboard

Syntax for Pulling in Subcomponents

Open tgockel opened this issue 5 years ago • 0 comments

Currently, $include pulls in entire files. Many YAML tools support the JSON Reference syntax for pulling in pieces of other files as part of the URI fragment. This would extend the syntax to be: ${file}[#${reference}] where reference is a JSON reference.

As an example, if my file a.yml looks like:

foo:
  potato: 6
bar:
  taco: 10

And my referring file looks like:

blub:
  $include: './a.yml#/bar'

The output would look like:

blub:
  taco: 10

tgockel avatar Nov 11 '18 20:11 tgockel