From 58ee1984b3b3a259cc8daeae77e0b66dd0af868f Mon Sep 17 00:00:00 2001 From: Kay Ulbrich Date: Mon, 21 Oct 2024 16:56:20 +0200 Subject: [PATCH] Added Jackson Kotlin module to client ObjectMapper --- conductor-clients/java/conductor-java-sdk/build.gradle | 1 + .../netflix/conductor/common/config/ObjectMapperProvider.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conductor-clients/java/conductor-java-sdk/build.gradle b/conductor-clients/java/conductor-java-sdk/build.gradle index 84568f0f4..de4e1a47a 100644 --- a/conductor-clients/java/conductor-java-sdk/build.gradle +++ b/conductor-clients/java/conductor-java-sdk/build.gradle @@ -33,6 +33,7 @@ subprojects { implementation "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" implementation "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}" implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${versions.jackson}" + implementation "com.fasterxml.jackson.module:jackson-module-kotlin:${versions.jackson}" implementation "org.slf4j:slf4j-api:${versions.slf4j}" implementation "org.apache.commons:commons-lang3:${versions.commonsLang}" diff --git a/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/common/config/ObjectMapperProvider.java b/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/common/config/ObjectMapperProvider.java index 04b36ecf2..bc637fc15 100644 --- a/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/common/config/ObjectMapperProvider.java +++ b/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/common/config/ObjectMapperProvider.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.module.kotlin.KotlinModule; public class ObjectMapperProvider { @@ -36,6 +37,7 @@ private static ObjectMapper _getObjectMapper() { JsonInclude.Include.NON_NULL, JsonInclude.Include.ALWAYS)); objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); objectMapper.registerModule(new JavaTimeModule()); + objectMapper.registerModule(new KotlinModule.Builder().build()); return objectMapper; } -} \ No newline at end of file +}