In Java EE, how to configure container to render null properties using only JAX-RS standard, without annotating or otherwise configuring an actual JAR-RS implementation? And is it possible at all? As an example, lets say I have an end-point and a pojo, and I am returning POJO with some properties set to null. As a result I'd like to see such null properties to be included in JSON too.
POJO:
class Pojo{
String name;
String value;
}
End-point (configured to produce JSON):
Response getPojo(){
Pojo p = new Pojo();
p.setName("somename");
return Response.ok(p).build();
}
Will produce:
{"name":"somename"} // no value at all
While I'd like to have it like:
{"name":"somename", "value":null} // value is null
Are there any Java EE standard ways to configure such behaviour without messing up with underlying JAX-RS implementation?