Use case
We often use ObjectMapper for just json parsing and not full object mapping. Initialization of KotlinAnnotationIntrospector currently causes a delay because of Kotlin Reflection loading. We would like to eliminate this delay until it is really needed.
Describe the solution you'd like
Replace
val UNIT_TYPE: KType = Unit::class.createType()
with
val UNIT_TYPE: KType by lazy { Unit::class.createType() }
Describe alternatives you've considered
Alternative would be avoiding creating UNIT_TYPE altogther and replacing single usage returnType == UNIT_TYPE with checking FQN since it is well-known.
Use case
We often use ObjectMapper for just json parsing and not full object mapping. Initialization of
KotlinAnnotationIntrospectorcurrently causes a delay because of Kotlin Reflection loading. We would like to eliminate this delay until it is really needed.Describe the solution you'd like
Replace
with
Describe alternatives you've considered
Alternative would be avoiding creating
UNIT_TYPEaltogther and replacing single usagereturnType == UNIT_TYPEwith checking FQN since it is well-known.