How can I set a value in YAML from another key e.g:
example.emails:
- [email protected]
- [email protected]
- [email protected]
swift:
to_email: example.emails
How can I set a value in YAML from another key e.g:
example.emails:
- [email protected]
- [email protected]
- [email protected]
swift:
to_email: example.emails
Ohh found the answer, just could not seem to find good documentation from Google :S
example.emails:
- [email protected]
- [email protected]
- [email protected]
swift:
to_email: "%example.emails%"
%
) do? Does this interpolate somehow? A full example would be greatly appreciated. –
Environs "%example.emails%"
that might be so, but that has nothing to do with the question. –
Intrauterine example.emails
is placed as a parameter –
Johnathon Accepted answer is wrong. It might have worked for the author for app specific reason but it is not supported by YAML specs. The correct way to reuse values in yaml is through something called anchors, like this
x1: &my_anchor
y: 'my val'
x2:
<<: *my_anchor
z: 3
In above, we mark the values in x1
using anchor my_anchor
. Then the special syntax <<: *my_anchor
tells YAML parser to insert children of the node (in this case y
) in the same level. So x2
will now have two children: y
and z
.
Ohh found the answer, just could not seem to find good documentation from Google :S
example.emails:
- [email protected]
- [email protected]
- [email protected]
swift:
to_email: "%example.emails%"
%
) do? Does this interpolate somehow? A full example would be greatly appreciated. –
Environs "%example.emails%"
that might be so, but that has nothing to do with the question. –
Intrauterine example.emails
is placed as a parameter –
Johnathon © 2022 - 2024 — McMap. All rights reserved.