Issue:
Despite not having contactEnrichment in the input JSON, the output JSON always includes “contactEnrichment”: {}. I want to completely omit the contactEnrichment field when it’s empty or not present in the input.
Current Behaviour:
{
"contactEnrichment": {}
}
Question:
How can I modify my Jolt spec to remove the contactEnrichment field from the output JSON when it’s empty or not present in the input?
Any help or guidance on this would be greatly appreciated!
What I’ve Tried:
Adjusting the Jolt spec to conditionally include contactEnrichment – couldn’t find a way to conditionally remove fields.
Post-processing the JSON to remove empty fields – looking for a more elegant solution within Jolt.
Sanskar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.