jacks
jacks copied to clipboard
@JsonProperty set on case classes methods is ignored
The serialization of case classes includes only fields declared in the primary constructor However it is sometimes interesting to add some extra fields (that could be used by the JsonCreator in the deserialization phase) in the resulting JSON string.
One solution to do that with Jackson is to add the @JsonProperty annotation on the method one want to serialiaze the result (see http://stackoverflow.com/questions/14362247/jackson-adding-extra-fields-to-an-object-in-serialization).
But it seems it is not supported by the current implementation of Jacks.
My goal was to include lazy fields in the JSON string. Is there another way to achieve this ?