Returning JSON null fields in API responses

Hi,
I’ve found that when returning an JSON object that has null fields these are not included in the response.
For example if in my handler (node.js) I perform the following:

module.exports.getUserTest = function(event, context, cb) {
var myReturnObject = {
name: “Rick Deckard”,
genre: “male”,
phone: null,
city: null
}

return cb(null, myReturnObject);
}

The response the client gets is:
{
“name”: “Rick Deckard”,
“genre”: “male”
}

How can I return null fields?

Thank you in advance

Not sure how to pass back null values but perhaps you check this in your code?

var test = {
"name": "Rick Deckard",
"genre": "male"
}
console.log(test.phone) // undefined

if (!test.phone) {
  alert('No phone!')
}

Short answer: You can’t

Long answer: JSON doesn’t support null values. You’ll need to use an empty string so something else (that you client understands) to represent a null value.