You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Given the following classes structure:
data class A (
@get:JsonUnwrapped(prefix = "prefix1.")
val b: B
)
data class B(
@get:JsonUnwrapped(prefix = "prefix2.")
val c: C
)
data class C(
@get:JsonProperty("prop")
val prop: String
)
As a side effect this bug allows to write field with duplicated names
data class A (
@get:JsonUnwrapped(prefix = "prefix1.")
val b1: B,
@get:JsonUnwrapped(prefix = "prefix2.")
val b2: B
)
data class B(
@get:JsonUnwrapped(prefix = "b.")
val c: C,
)
data class C(
@get:JsonProperty("prop")
val prop: String
)
val a = A(
b1 = B(C("val1")),
b2 = B(C("val2"))
)
ObjectMapper.writeValueAsString(a)
However, as shown in the sample code, this is a databind issue since kotlin-module is not used.
This issue is closed as a duplicate of the following FasterXML/jackson-databind#2461
Describe the bug
Given the following classes structure:
Trying to serialize this:
Actual result:
Expected result
Versions
Kotlin:
Jackson-module-kotlin: 2.13.1
Jackson-databind: 2.13.1
The text was updated successfully, but these errors were encountered: