Skip to content

Add MapperFeature.REQUIRE_HANDLERS_FOR_JAVA8_TIMES to disable the "Java 8 date/time XYZ not supported by default" error #4533

@stickfigure

Description

@stickfigure

Is your feature request related to a problem? Please describe.

Jackson 2.12 introduced the "always break when trying to serialize java.time objects without the JavaTimeModule` behavior.

Unfortunately, this breaks our 1M+ line codebase which makes ObjectMappers all over the place. And we have client applications that expect the (terrible) POJO format for some time objects.

It looks like you've already thought about this with your comment here:

// 05-May-2020, tatu: Should we check for possible Shape override to "POJO"?

We've pinned jackson to 2.11.4 across the board but this is not a sustainable solution.

Describe the solution you'd like

Ideally, a system property that restores the old behavior - let java.time.* be serialized as objects. A distant second would be a feature to enable on the objectmapper which restores old behavior. That would require hunting down every possible objectmapper creation in our codebase, which will hurt.

Usage example

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.19Issues planned at 2.19 or later

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions