We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9cdff7a commit 6f6cfd9Copy full SHA for 6f6cfd9
temporal-kotlin/src/main/kotlin/io/temporal/common/converter/KotlinObjectMapperFactory.kt
@@ -29,9 +29,14 @@ class KotlinObjectMapperFactory {
29
fun new(): ObjectMapper {
30
val mapper = JacksonJsonPayloadConverter.newDefaultObjectMapper()
31
32
- // use deprecated constructor instead of builder to maintain compatibility with old jackson versions
33
- @Suppress("deprecation")
34
- val km = KotlinModule()
+ val km = try {
+ KotlinModule.Builder()
+ .build()
35
+ } catch (e: ClassNotFoundException) {
36
+ // use deprecated constructor as fallback
37
+ @Suppress("deprecation")
38
+ KotlinModule()
39
+ }
40
mapper.registerModule(km)
41
return mapper
42
}
0 commit comments