I am working on transforming my payload. I have got the situation here.
Input payload looks like this below one:-
{
"address": {
"city": "bab",
"company_name": "asdast",
"country_code": "sam",
"location": {
"city": null,
"state": null
}
}}
I used %output application/json skipNullOn = "everywhere"
it returns me JSON like below
{
"address": {
"city": "bab",
"company_name": "asdast",
"country_code": "sam",
"location": { }
}}
But I don't want to have empty location object if all fields in location objects are empty.I am expecting something like this
{
"address": {
"city": "bab",
"company_name": "asdast",
"country_code": "sam"
}}