jackson-module-kogera
jackson-module-kogera copied to clipboard
When directly deserializing a `value class` that wraps a nullable, deserialization fails if the input is `null`.
The ValueClassDeserializer::getBoxedNullValue
is called only from the KotlinValueInstantiator
.
This causes deserialization to fail as per the subject.
@JvmInline
value class NullableObject(val v: String?)
val result = mapper.readValue<NullableObject>("null")
This problem can be avoided by implementing getNullValue
to the inherent ValueClassDeserializer
.
However, the general implementation of Kogera
does not use getNullValue
because of the problem in the more major cases.
Also, the above problems make it difficult to solve this problem.