I want to transform below input json to output json using JOLT. The main problem here is in the list, I have to remove some fields whose root key (Param1, Param2, ...) will differ dynamically. I tried below spec, which didn't work. Need help in this case.
Input JSON : [
{
"paramCollection": [
{
"Param1": {
"value": 1,
"limit": "10"
}
},
{
"Param2": {
"value": 1,
"limit": "20"
}
}
]
}
]
Output JSON : [ {
"paramCollection" : [ {
"Param1" : {
"value" : 1
}
}, {
"Param2" : {
"value" : 1
}
} ]
} ]
spec : [
{
"operation": "remove",
"spec": {
"*": {
"paramCollection" : {
"*": {
"[&1].[&1].limit": ""
}
}
}
}
}
]