Skip to content

[FEATURE] Support Jackson3 in @Jacksonized #3950

@cachescrubber

Description

@cachescrubber

Describe the feature

New major version 3.0.0 of Jackson Databind is near (current: 3.0.0-rc9) . The @Jacksonized feature is using @JsonDeserialize and @JsonPOJOBuilder which will be relocated to a new java package:

Jackson 2.20.0

  • @com.fasterxml.jackson.databind.annotation.JsonDeserialize
  • @com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder

Jackson 3.0.0

  • @tools.jackson.databind.annotation.JsonDeserialize
  • @tools.jackson.databind.annotation.JsonPOJOBuilder

Example Class

The following class could not be deserialized using Jackson 3

@Getter
@SuperBuilder(toBuilder = true)
@EqualsAndHashCode
@ToString
@Jacksonized
public class TestEntity {

  @JsonProperty
  private final String id;

  @JsonProperty
  private final String name;
}

I created a reproducible example.

Additional context

  • The Jackson Annotation Api will be kept the same for both Jackson 2 and 3. Unfortunately, the above Annotations are not part of the com.fasterxml.jackson.annotation Package.
  • For the sake of migration, many projects will use Jackson2/3 in parallel. An option to use both annotations in parallel could be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions