# jackson-kotlin

Yonatan Karp-Rudin

12/11/2023, 9:13 AM
Hi all, I'm facing an issue to upgrade from Kotlin
to version
or above because of serialization value classes inside of a data class. Let's consider the following example:
Copy code
value class Value(val i: Int)

data class Data(val j: Value)

data class Wrapper(val value: Value, val data: Data)
When trying the following code:
Copy code
val objectMapper = jacksonObjectMapper()
    .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)

val json = """{"i":1,"j":771}"""

val deserialized = objectMapper.readValue<Wrapper>(json)
This code execution ends up with the following error:
(no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
. This can be resolved by adding an empty constructor to the classes, but it makes very little sense, and I'm afraid that it would be abused by other developers in the codebase... is there any alternative that I can use here to solve the issue?
Mmmm... found this discussion on GitHub - so I guess I should wait 🙈
👍 1