I want to transform this JSON
{"property": "value","array1": [ {"name": "A","propertyA1": "1","propertyA2": "2" }, {"name": "B","propertyB1": "1","array2": [ {"name": "C","propertyC1": "1","propertyC2": "2" } ] } ]}into that using a JQ filter.
{"property": "value","array1": {"A": {"propertyA1": "1","propertyA2": "2" },"B" : {"propertyB1": "1","array2": {"C" : {"propertyC1": "1","propertyC2": "2" } } } }}The difficulty is to make this work recursively. Moreover, only arrays whopossess an object with a property name should be considered. I had a few attempts butit already fails if I want to add a new property do the arrays (I know it's not possible,since it is an array).