From 9119309f68935fe05c62541633cf3d862f11f01b Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Fri, 29 Nov 2024 23:48:38 +0900 Subject: [PATCH 1/2] Update jackson version --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cc249f8..df6bfd6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] kotlin = "1.9.25" # Mainly for CI, it can be rewritten by environment variable. -jackson = "2.18.1" +jackson = "2.18.2" # test libs junit = "5.11.3" From f4a29e22e1542e9dfb50a0324fa7e22f179cdea3 Mon Sep 17 00:00:00 2001 From: wrongwrong Date: Sun, 24 Nov 2024 01:47:12 +0900 Subject: [PATCH 2/2] Porting check for #841 https://github.com/FasterXML/jackson-module-kotlin/pull/850 --- .../kogera/zPorted/test/github/GitHub841.kt | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github/GitHub841.kt diff --git a/src/test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github/GitHub841.kt b/src/test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github/GitHub841.kt new file mode 100644 index 0000000..75a7640 --- /dev/null +++ b/src/test/kotlin/io/github/projectmapk/jackson/module/kogera/zPorted/test/github/GitHub841.kt @@ -0,0 +1,34 @@ +package io.github.projectmapk.jackson.module.kogera.zPorted.test.github + +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.databind.ObjectMapper +import io.github.projectmapk.jackson.module.kogera.readValue +import io.github.projectmapk.jackson.module.kogera.registerKotlinModule +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test + +class GitHub841 { + object Foo { + override fun toString(): String = "Foo()" + + @JvmStatic + @JsonCreator + fun deserialize(): Foo { + return Foo + } + } + + private val mapper = ObjectMapper() + .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) + .registerKotlinModule() + + @Test + fun shouldDeserializeSimpleObject() { + val value = Foo + val serialized = mapper.writeValueAsString(value) + val deserialized = mapper.readValue(serialized) + + assertEquals(value, deserialized) + } +}