Skip to content

Commit be36a06

Browse files
committed
Fix #1654: @JsonDeserialize(contentUsing) ignored when @JsonTypeInfo(use=NONE)
1 parent bb7b024 commit be36a06

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/tools/jackson/databind/deser/BasicDeserializerFactory.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import tools.jackson.databind.ext.jdk8.OptionalLongDeserializer;
2525
import tools.jackson.databind.introspect.*;
2626
import tools.jackson.databind.jsontype.TypeDeserializer;
27+
import tools.jackson.databind.jsontype.impl.NoOpTypeDeserializer;
2728
import tools.jackson.databind.type.*;
2829
import tools.jackson.databind.util.*;
2930

@@ -767,8 +768,12 @@ public ValueDeserializer<?> createCollectionDeserializer(DeserializationContext
767768

768769
// Then optional type info: if type has been resolved, we may already know type deserializer:
769770
TypeDeserializer contentTypeDeser = (TypeDeserializer) contentType.getTypeHandler();
770-
// but if not, may still be possible to find:
771-
if (contentTypeDeser == null) {
771+
// [databind#1654]: @JsonTypeInfo(use = Id.NONE) should not apply type deserializer
772+
// when custom content deserializer is specified via @JsonDeserialize(contentUsing = ...)
773+
if (contentTypeDeser instanceof NoOpTypeDeserializer) {
774+
contentTypeDeser = null;
775+
} else if (contentTypeDeser == null) {
776+
// but if not, may still be possible to find:
772777
contentTypeDeser = ctxt.findTypeDeserializer(contentType);
773778
}
774779
// 23-Nov-2010, tatu: Custom deserializer?

0 commit comments

Comments
 (0)