Skip to content

Allow handling of single-arg constructor as property based by default #1498

@lpandzic

Description

@lpandzic
class Foo {
    private final Bar bar;

    Foo(Bar bar) {
        this.bar = bar;
    }
}

With the parameter-names-module enabled I'd expect this class to be correctly deserialized from {"bar":{...}}.
More than once have users hit this issue and asked why isn't it handled this way (#1135, #8, #21).
It might also be a good idea to provide an option to change this behavior (HANDLE_SINGLE_ARG_CONSTRUCTOR_AS_PROPERTY_CREATOR).

Metadata

Metadata

Assignees

No one assigned

    Labels

    most-wantedTag to indicate that there is heavy user +1'ing action

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions