Input:
{
//The input json object
}
Desired Output:
{
"Event1": "Value1",
"Event2": [
// collection of json objects
],
"Event3": {
//The input json object
}
}
So basically the input json goes in the "Event3" of another json object wrapper.
This is my Spec:
[
{
"operation": "shift",
"spec": {
"@": "Event3"
}
},
{
"operation": "default",
"spec": {
"Event1": "Value1",
"Event2": [
// some objects
]
}
}
]
Now the problem is - the above spec is doing the transformation, but ordering of the objects are messed up, like this:
{
"Event3": {
//The input json object
},
"Event2": [
// some objects
],
"Event1": "Value1"
}
Please suggest how should I fix this.