3 ms·
YAML is (almost) a superset of JSON. So it is much easier to serialize data into JSON than avoiding worrying about indentation.
by kevincox 3y ago
YAML is (almost) a superset of JSON. So it is much easier to serialize data into JSON than avoiding worrying about indentation.
- mdaniel 3y agoI think you are lobbying the wrong person about the relationship between yaml and json; I was trying to point out that you had thing: - item1 - {{ foo | toJson }} # <-- is not going to do what you expect unless you quite literally wanted thing: - alpha - - alpha1 - alpha2
- kevincox 3y agoAh, I did have a typo. But you also copied it wrong. I wrote this labels: - mylabel - {{ extraLabels | indent 4 }} # toJson doesn't work here. Which has an extra `-` and as you pointed out would produce a nested list. But I meant this which would merge the lists. labels: - mylabel {{ extraLabels | indent 4 }} # toJson doesn't work here.