I have a JSON Payload and I would like to use the name of each repeating object and add it to the body :
{
"error": [],
"result": {
"trades": {
"foo-test-UCI7BS": {
"ordertxid": "00TEST",
"postxid": "00TEST"
},
"foo-test-3FKGH6": {
"ordertxid": "00TEST",
"postxid": "00TEST"
}
},
"count": 2346
}
}
Expected output with object names within the body, this is a repeating element so needs to be dynamically added:
{
"trades": [
{
"ordertxid": "00TEST",
"postxid": "00TEST",
"ID": "foo-test-UCI7BS"
},
{
"ordertxid": "00TEST",
"postxid": "00TEST",
"ID": "foo-test-3FKGH6"
}
]
}
I have already been successful in getting the array but I need the object name to be included within the body
{
"trades": [
{
"ordertxid": "00TEST",
"postxid": "00TEST"
},
{
"ordertxid": "00TEST",
"postxid": "00TEST"
}
]
}
Spec:
[
{
"operation": "shift",
"spec": {
"result": {
"trades": {
"*": "trades"
}
}
}
}
]