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
When in a kotlin data class a parameter is nullable, a payload with a missing value is desirialized and results in NullNode assigned to such a property
To Reproduce
kotlin: data class TestDataClass(val jsonNodeValue: JsonNode?)
Java: TestDataClass value = om.readValue("{}", TestDataClass.class); assertThat(value.getJsonNodeValue()).isNull();
Expected behavior
a missing optional value should be desirialized as null and not NullNode
Hi! This is a great change and definitely the better default behavior. However, moving from 2.11 -> 2.13 was a breaking change for us, as we expected a Kotlin non-null value (previously a NullNode) and so threw at runtime. We've already fixed this by allowing null values, but it was a surprising change that required a non-trivial change. Is there any way to configure the object mapper to toggle between these two behaviors?
Describe the bug
When in a kotlin data class a parameter is nullable, a payload with a missing value is desirialized and results in NullNode assigned to such a property
To Reproduce
kotlin:
data class TestDataClass(val jsonNodeValue: JsonNode?)
Java:
TestDataClass value = om.readValue("{}", TestDataClass.class); assertThat(value.getJsonNodeValue()).isNull();
Expected behavior
a missing optional value should be desirialized as null and not NullNode
Versions
Kotlin: 1.4
Jackson-module-kotlin: 2.11.4
Jackson-databind: 2.11.4
Additional context
PR: #491
The text was updated successfully, but these errors were encountered: