I have a json object that contains nested arrays, a simplified example is:
{
"Attr1" : [{
"Attr2" : [{
"Attr3" : "A"
}
]
}, {
"Attr2" : [{
"Attr3" : "B"
}, {
"Attr3" : "C"
}
]
}, {
"Attr2" : [{
"Attr3" : "D"
}, {
"Attr3" : "E"
}, {
"Attr3" : "F"
}
]
}
]
}
I would like to extract just attr3, either as a (complex) list, or a valid json ex. [{"Attr3":"A"},{"Attr3":"B"},{"Attr3":"C"},{"Attr3":"D"},{"Attr3":"E"},{"Attr3":"F"}]
If I use the JSONExtractor with json["Attr1"][*]["Attr2"][*]
I get {"Attr3":"A"}{"Attr3":"B"}{"Attr3":"C"}{"Attr3":"D"}{"Attr3":"E"}{"Attr3":"F"}'
without commas between elments.
The JSONFlattener with recursion does work, but the actual json has a couple of hundred additional elements, and I would like to avoid creating them unnecessarily if possible.