-
-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
Describe the bug
Controlling the serialized field name with @JsonProperty
doesn't appear to be working for fields in a superclass.
To Reproduce
open class Parent(@JsonProperty("parent-prop") val parent: String)
class Child(@JsonProperty("child-prop") val child: String) : Parent(child)
println(jacksonObjectMapper().writeValueAsString(Child("foo")))
yields {"child-prop":"foo","parent":"foo"}
.
Expected behavior
I would expect to see {"child-prop":"foo","parent-prop":"foo"}
.
Versions
Kotlin: 1.5.20
Jackson-module-kotlin: 2.12.3
Jackson-databind: 2.12.3