Skip to content

Instantly share code, notes, and snippets.

@sunitparekh
Last active April 2, 2018 17:09
Show Gist options
  • Save sunitparekh/605f12f9cbc1c66bb0053e227327fe4c to your computer and use it in GitHub Desktop.
Save sunitparekh/605f12f9cbc1c66bb0053e227327fe4c to your computer and use it in GitHub Desktop.
JSON sample representing different responses for NULL and EMPTY values
// Response with null and empty values -- NOT RECOMMENDED, JUST FOR REPRESENTATION PURPOSE --
{
"employeeId": 12345,
"firstName": "Sunit",
"lastName": "Parekh",
"mobile": null,
"addresses": []
}
// Response without Null Values, Empty object or array is still present
{
"employeeId": 12345,
"firstName": "Sunit",
"lastName": "Parekh",
"addresses": []
}
// Response without Null and Empty Values
{
"employeeId": 12345,
"firstName": "Sunit",
"lastName": "Parekh"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment