Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When directly deserializing a value class that wraps a nullable, deserialization fails if the input is null. #209

Open
k163377 opened this issue Jan 14, 2024 · 0 comments
Labels
value class About value class support

Comments

@k163377
Copy link
Contributor

k163377 commented Jan 14, 2024

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.

@k163377 k163377 added the value class About value class support label Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
value class About value class support
Projects
None yet
Development

No branches or pull requests

1 participant