yaml-spec
yaml-spec copied to clipboard
Feature request: string interpolation
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: 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.