Hi,
There are multiple solutions for your problem. The easiest in terms of implementation(but probably not covering all possible usecases) would be to use a text driver for manually producing JSON output. Something like this:
<query connection-id="csv">
<script connecton-id="text">
{
id: "$id",
name: "$name"
}
</script>
</query>
Please note that you might need escaping of outputted values, ${name.replaceAll("fromRegex", "toRegEx")} or a dedicated utility method can be used for that purpose.
Another way of producing JSON output is to use Janino for producing an object from CSV properties and serialize it to String as JSON using some third-party library like Jackson. But it's more complex.
Probably the most complex way, but also a very helpful for the community would be to create a driver for running queries(in JSON syntax) over JSON content in <query> elements and output a properly as escaped JSON in <script>.