I want to deserialize a JSON-Object with Jackson. Because the target is an interface I need to specify which implementation should be used.
This information could be
There is another approach that will work if you have just single interface implementation.
public class ClassYouWantToDeserialize {
@JsonDeserialize(as = ImplementationClass.class)
private InterfaceClass property;
...
}
This question was answered a while ago but I want to give you another option that doesn't require to tune ObjectMapper and also much simpler then @JsonTypeInfo annotation.