-
1. Re: Enable null or empty fields in JSON RESTEasy output
gaborj Apr 8, 2010 8:35 PM (in response to bgroeneveld)Hi,
I think this is not seam topic, not even RESTEasy but the providers you mention, probably try there with more success...
In Jackson you can do:objectMapper.configure(SerializationConfig.WRITE_NULL_PROPERTIES, true);
PS: Are you sure you want to send those bytes to the client without any useful information? What about the
green
aspects of programming? ;) Probably the client should handle that... -
2. Re: Enable null or empty fields in JSON RESTEasy output
bgroeneveld Apr 9, 2010 8:33 PM (in response to bgroeneveld)Agreed, handling this on the client works well also. Looks like Jackson also offers @JsonWriteNullProperties. I might suggest everything Seam integrates is a candidate Seam topic in that the whole point of Seam is bringing all these technologies together. Our challenge is in using Jackson in entity graph traversal. Since Hibernate uses dynamic proxies to lazy load these need to be removed if you want to serve them up using JAX-RS and JAX-B. So we end up pulling in the Gilead toolkit to get hibernate out of our pojos and using the CycleRecoverable interface in Jettison to deal with natural loops in our entity graphs. It works quite well; We just wish we could use Jackson, but it doesn't yet have enough configurable flexibility to deal cycles yet - as far as we have found.