Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

How to exclude parent when children are null

$
0
0

Is there a way to exclude the parent object when the child elements are all null?

JSON Example:

This is the current generated output:
{
"name":"John Smith",
"address": {
"street": null,
"city": null,
"state": null,
"zip": null
}
}

What I want is:
{
"name":"John Smith"
}

How can I make address and all it's elements go away when the elements are all null?


Viewing all articles
Browse latest Browse all 2665

Trending Articles