I have a Jackson Question.
Is there a way to deserialize a property that may have two types, for some objects it appears like this
\"someObj\" : { \"
None of the other answers worked for me:
ObjectMapper
cannot be modified and we use a @JsonDeserialize
annotation to install the deserializer.ObjectMapper
either.Map
to be properly typed, which didn't seem to work with ObjectCodec.treeToValue
.This is the solution that finally worked:
public class EmptyArrayToEmptyMapDeserializer extends JsonDeserializer