Below json is my input.
{
"payload": {
"KA01B3432": "KA01B3432",
"KA02A3123": "KA02A3123"
}
}
Using JSONATA i need to format the above JSON to below format.
[
{
"KA01B3432": "KA01B3432"
},
{
"KA02A3123": "KA02A3123"
}
]
I tried payload.[$keys()]
but this will yield only keys in array format not whole object in array format.
{
"payload": {
"KA01B3432": "KA01B3432",
"KA02A3123": "KA02A3123"
}
}
to
[
{
"KA01B3432": "KA01B3432"
},
{
"KA02A3123": "KA02A3123"
}
]
$spread(payload)
does what you need.