Skip to content

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

@k163377

Description

@k163377

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    value classAbout value class support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions