|
|
|
|
|
by kevincox
923 days ago
|
|
I totally agree that string-templating into a data serialization format is a mistake. But you can make life dramatically easier on yourself by doing `{{ something | toJson }}`. In fact write a linter that every single substitution is followed by `| toJson` and you will save yourself a lot of headaches. The main issue is that it make it more difficult to mix hardcoded and inserted values. labels:
- mylabel
- {{ extraLabels | indent 4 }} # toJson doesn't work here.
Also the small technical concern that YAML isn't actually a superset of JSON. (But you are far less likely to hit these cases than other escaping bugs). |
|