diff --git a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt index 0054b365..92533d55 100644 --- a/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt +++ b/src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinAnnotationIntrospector.kt @@ -68,7 +68,11 @@ internal class KotlinAnnotationIntrospector( override fun findSerializationConverter(a: Annotated): Converter<*, *>? = when (a) { // Find a converter to handle the case where the getter returns an unboxed value from the value class. is AnnotatedMethod -> a.findValueClassReturnType()?.let { + // To make annotations that process JavaDuration work, + // it is necessary to set up the conversion to JavaDuration here. + // This conversion will cause the deserialization settings for KotlinDuration to be ignored. if (useJavaDurationConversion && it == Duration::class) { + // For early return, the same process is placed as the branch regarding AnnotatedClass. if (a.rawReturnType == Duration::class.java) KotlinToJavaDurationConverter else