Hi, I am new with kotlin. Can you help me with thi...
# jackson-kotlin
p
Hi, I am new with kotlin. Can you help me with this data mapping problem? https://kotlinlang.slack.com/archives/C0B8MA7FA/p1710426539628479
j
Copy code
ObjectMapper().apply { 
    registerKotlinModule() 
}.writeValueAsString(MyClass(...))
You don't need
@JsonCreator
and if you want to specify names for fields explicitly for data classes you do:
Copy code
data class MyClass(
    @field:JsonProperty("changed_at")
    val changedAt: LocalDate
)
I suggest browsing through the kotlin module: https://github.com/FasterXML/jackson-module-kotlin