Skip to content

Support Jackson3 with Spring Boot 4.x when using DefaultObjectSerializer #1647

@atrauzzi

Description

@atrauzzi

Encountered a scenario where a dev is customizing Dapr's ObjectMapper by extending DefaultObjectSerializer and modifying the static OBJECT_MAPPER:

static {
  OBJECT_MAPPER.findAndRegisterModules();
  OBJECT_MAPPER.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
  OBJECT_MAPPER.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
}

This will break with Jackson 3.x because ObjectMapper/JsonMapper is now fully immutable - configuration must happen at construction time via builder pattern. Methods like disable(), enable(), configure() no longer exist on the mapper instance.


Is there an alternative available for people who have made this kind of customization?

cc. @salaboy

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions