Open shawalli opened 1 year ago
Many languages support some form of string interpolation. Adding string interpolation to YAML would enhance anchors/aliases. Below is a contrived example. Obviously the interpolation markers may not work, but this is just to give an idea.
user: &user john cname: "{{ *user }}.somesite.com" host: "{{ *user }}.ec2.somecompany" shared-dir: "/some/shared/path/{{ *host }}"
In this example, user is interpolated into cname and hostname, andhost is interpolated into shared-dir, resulting in:
user
cname
hostname
host
shared-dir
user: john cname: "john.somesite.com" host: "john.ec2.somecompany" shared-dir: "/some/shared/path/john.ec2.somecompany"
Not sure if this is the right place to request new features for the spec, so let me know if I should post elsewhere.
Many languages support some form of string interpolation. Adding string interpolation to YAML would enhance anchors/aliases. Below is a contrived example. Obviously the interpolation markers may not work, but this is just to give an idea.
In this example,
user
is interpolated intocname
andhostname
, andhost
is interpolated intoshared-dir
, resulting in:Not sure if this is the right place to request new features for the spec, so let me know if I should post elsewhere.