Skip to content

Type id not provided on Double.NaN, Infinity with @JsonTypeInfo #2236

@C-B-B

Description

@C-B-B

When using polymorphic serialisation with @JsonTypeInfo, e.g. on a Collection of Objects, the type information is sent with the values to ensure correct deserialisation. Doubles (and others like Strings) don't get their types included given they are considered the default deserialisation type. This causes problems for Double.NaN, Double.POSITIVE_INFINITY and Double.NEGATIVE_INFINITY as they get deserialised into strings rather than Double.

Would it make sense to include the type for these three Double values to ensure they can also be correctly deserialised (I tested that the deserialisation works correctly if the type is included in the data)?

(Using 2.9.8)

Thanks!
CBB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions