I need help to remove null elements from JSON using jolt. I want to remove only root level elements containing null.
Input :
{
"x": null,
"y": null,
"z": [
{
"id": "1",
"name": "2",
"price": null,
"quantity": 1
}
]
}
Expected Output
{
"z": [
{
"id": "1",
"name": "2",
"price": null,
"quantity": 1
}
]
}
2
Answers
Just dive one level deeper while using basic
"*": "&"
match in order the attributes stated at the outermost level with null values to vanish such asthe demo on the site http://jolt-demo.appspot.com/ is
You can use the value of the
z
and bring in thez
like this: