If it's the whitespace that jams you up, I wanted to point out that since YAML is a superset of JSON, there's nothing stopping you from using text/template to cook JSON manifests. There is, of course, a toJson function available in helm <https://helm.sh/docs/chart_template_guide/function_list/#typ...>
But I'm conceptually with you that the jokers who decided to use a text templating language for a structured output were gravely misguided and now we all suffer