Skip to content

Add MapperFeature.INFER_CREATOR_FROM_CONSTRUCTOR_PROPERTIES to allow disabling use of @ConstructorProperties as explicit @JsonCreator equivalent #1371

@cowtowncoder

Description

@cowtowncoder

One challenge with frameworks like Lombok, auto-values and Immutables is that they often automatically (or at least by default) add JDK7 JDK6 @ ConstructorProperties annotation for constructor(s). This makes sense, in general, but may be problematic for Jackson since as of 2.8 that is equivalent to specifying @JsonCreator, which may not always be what is intended.

One thing that can help resolve issues is to add a new MapperFeature, enabled by default, that determines whether @ ConstructorProperties means same as explicit @JconCreator (enabled) or not (disabled). If not, parameter names are still available as implicit names, and explicit @JsonCreator may be used.

Note that this requires #1369 as well.

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