We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67cc4b2 commit addc854Copy full SHA for addc854
temporal-kotlin/src/main/kotlin/io/temporal/common/converter/KotlinObjectMapperFactory.kt
@@ -21,24 +21,15 @@
21
package io.temporal.common.converter
22
23
import com.fasterxml.jackson.databind.ObjectMapper
24
-import com.fasterxml.jackson.module.kotlin.KotlinModule
+import com.fasterxml.jackson.module.kotlin.registerKotlinModule
25
26
class KotlinObjectMapperFactory {
27
companion object {
28
@JvmStatic
29
fun new(): ObjectMapper {
30
val mapper = JacksonJsonPayloadConverter.newDefaultObjectMapper()
31
32
- val km = try {
33
- KotlinModule.Builder()
34
- .build()
35
- } catch (e: NoClassDefFoundError) {
36
- // use deprecated constructor as fallback
37
- @Suppress("deprecation")
38
- KotlinModule()
39
- }
40
- mapper.registerModule(km)
41
- return mapper
+ return mapper.registerKotlinModule()
42
}
43
44
0 commit comments