I have an object myObject
with many values set to null
, first
set to 502296999
and the second
is empty (""
). In response I have:
"Phones": {
"First": "502296999"
}
while I would like to receive this:
"Phones": {
"First": "502296999",
"Second": ""
}
I am building the response this way:
return Response.ok(myObject).build();
Is there an easy way to also put the fields with value ""
into response? Or to force Response.ok(myObject).build()
to always add those two fields no matter what is inside?