Skip to content

Missing value of type JsonNode? is deserialized as NullNode instead of null #490

@novtor

Description

@novtor

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions