diff --git a/src/main/java/com/fasterxml/jackson/databind/AnnotationIntrospector.java b/src/main/java/com/fasterxml/jackson/databind/AnnotationIntrospector.java index 18f0f02ae6..fcfd0b5164 100644 --- a/src/main/java/com/fasterxml/jackson/databind/AnnotationIntrospector.java +++ b/src/main/java/com/fasterxml/jackson/databind/AnnotationIntrospector.java @@ -59,7 +59,7 @@ public enum Type { * Usually this can be defined by using * {@link com.fasterxml.jackson.annotation.JsonManagedReference} */ - MANAGED_REFERENCE + MANAGED_REFERENCE, /** * Reference property that Jackson manages by suppressing it during serialization, @@ -67,7 +67,7 @@ public enum Type { * Usually this can be defined by using * {@link com.fasterxml.jackson.annotation.JsonBackReference} */ - ,BACK_REFERENCE + BACK_REFERENCE ; } diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java index 510984a8a8..3f3aff61b7 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java @@ -1031,6 +1031,10 @@ private boolean _checkIfCreatorPropertyBased(BeanDescription beanDesc, return true; } } + // [databind#3897]: Record canonical constructor will have implicitly named propDef + if (!propDef.isExplicitlyNamed() && beanDesc.isRecordType()) { + return true; + } } // in absence of everything else, default to delegating return false;