Just as a quick PSA, you can actually use YAML for parameters passed in to "-e @test/values" if you like.
In the above example, nestedVar is expressed as a string, but that string actually contains no quotes, so that's why you are not seeing quotes there.
The easiest suggestion here if you are trying to write a datastructure as json, is to have a template that is exactly this:
{{ datastructure | to_json }}
And it will do the right thing and use the kind of quoting that JSON entails.
This also has the added benefit of keeping everything in nice pure datastructures and not having to write something in a format for a particular datastructure.
By no means should you have to worry about regex replacements to solve this, that would be horribly painful :)