Open usulkies opened 4 years ago
Workaround: Annotate the property with @field:JsonProperty("property1")
From my check, it has started in version 2.9.7. I experienced it only now through Drpowizard bump 2.0.8 -> 2.0.9
I tried to reproduce it, but it seemed to randomly turn into TestMe1: {"property1": "prop1", "property2": "prop2"}
or TestMe1: {"property2": "prop2"}
.(!?)
To elaborate, Class.declaredMethods
returned a random order and private getter
came first, databind
would ignore that property.
It appears to be very difficult to fix this behavior in jackson-module-kotlin
.
On the other hand, it also seems difficult to solve this problem in data-bind
.
Please see the following issue for more information https://youtrack.jetbrains.com/issue/KT-23434
@cowtowncoder
May I close this issue?
I don't think it can be resolved until Kotlin
takes care of it.
Describe the bug When a data class contains a private getter
getProp
with return type TypeA and there's a class property namedprop
with type TypeB the JSON form of the class will not contain either of the properties.To Reproduce
Expected behavior
TestMe1: {"property1": "prop1", "property2":"prop2"}
Actual behavior
TestMe1: {"property2":"prop2"}
Versions Kotlin: 1.3.72 Jackson-module-kotlin: 2.10.4 (maybe before) Jackson-databind: 2.10.4 (maybe before)