Reputation: 21
I have a JSON input :
{
"partyContactList": [
{
"firstName": "r",
"lastName": "g",
"contactEnrichment": {}
}
]
}
and expected one as follows :
{
"partyContactList": [
{
"firstName": "r",
"lastName": "g",
}
]
}
where I'm trying to remove from Jolt transformation contactEnrichment : {}
, eg. Remove contact enrichment as its empty object.
Upvotes: 0
Views: 38
Reputation: 65323
You can use the following shift transformation spec :
[
{
"operation": "shift",
"spec": {
"*": {
"*": {
"*": "&2[&1].&",
"contactEnrichment": {
"*": "&3[&2].&1.&",
"": ""//an empty value matches another empty value whenever there's no comtent
}
}
}
}
}
]
Upvotes: 0