-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
If I have json that looks like
{
"something": [
{
"id": "a uuid",
"property": "value"
}
]
}
And I have a java pojo with an annotation like this:
@JsonDeserialize(as = MyHashMap.class)
private void setSomething(Map<UUID, Foo> incomingValue) {
Where MyHashMap.java has some custom logic using generics that allow us to map the array json above into a Map where "id" is the key and everything else serializes into the value. We use generics on MyHashMap to enforce that every value implements a certain interface that respects the contract of returning an "id" property. In this example Foo.java implements this interface MyCustomIdInterface.java.
When using 2.6.6 this worked fine, but if I switch to 2.7.x then it breaks with the error:
Can not construct instance of MyCustomIdInterface, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information
in 2.7.x, it looks like jackson resolves to using AbstractDeserializer based on MyCustomIdInterface but in 2.6.6 it resolves to using BeanDeserializer based on Foo.java.
Is this a bug or is there some default/feature flag that changed here?