Open samer1977 opened 6 months ago
A trick is to use a temporary parent node because recursivelySquashNulls only works on child nodes.
[
{
"operation": "shift",
"spec": {
"*": "tmpRoot.&"
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"tmpRoot": "=recursivelySquashNulls" //squashNulls same thing
}
},
{
"operation": "shift",
"spec": {
"tmpRoot": {
"*": "&"
}
}
}
]
Hi,
There should be a way to make the squashNulls \recursivelySquashNulls remove null objects from an array.
Example:
Input:
Spec:
Output:
Expected:
The only way to resolve this is through shift operation which can get cumbersome if the array is nested in a deeper level and is part of complex json where you not only have to traverse the hierarchy but also accommodate all other fields\objects in the spec to maintain the same structure.