Skip to content

Explicitly fail (de)serialization of java.time.* types in absence of registered custom (de)serializers #2683

@cowtowncoder

Description

@cowtowncoder

(inspired by #2626)

So, a relatively common problem by users seem to be the case of using Java 8 date/time types, without registered Java 8 date/time module. For serialization this can even produce seemingly legit JSON output as values are considered just POJOs/Beans, which is problematic as JSON representation will NOT be what module would support, nor something that can be deserialized.

While general case of knowing that something is missing wrt support is unsolvable, the specific case of java.time type support may be something we could perhaps detect.
My first idea is that when looking for (de)serializer, if no (de)serializer found via module registrations, trying to find one for java.time.* classes should give specific failure suggesting that module is needed, and NOT try to create Bean[De]Serializer.

Due to timing concerns (2.11.0.rc1 being tested, official 2.11.0 due soon) this will probably need to go in 2.12.0.

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