Michal Foksa Michal Foksa - 2 months ago 13
Java Question

Jackson: Register fallback deserializer for unknown properties

Is there a way in

Jackson
to register a custom deserializer (using annotations or another way) for unknown properties? Something like a fallback deserializer, called instead of throwing
UnrecognizedPropertyException
.

NOTE: I do not want to ignore unknown properties, I want to collect them.

Answer

Seems like @JsonAnySetter annotation might help. See how-to guide here http://vincentdevillers.blogspot.co.il/2013/08/how-to-map-unknown-json-properties-with.html

Comments