Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] Should @Jacksonized add @JsonProperty to fluent methods? #3270

@mjaggard

Description

@mjaggard

Describe the bug
When I apply @Builder and @Jacksonzied along with @Data or @Value and @Accessors(fluent = true) my object gets deserialised correctly but serialisation doesn't work and I end up with {}

To Reproduce

@Value
@Builder
@Jacksonized
@Accessors(fluent = true)
public static class MyObject {
        String objectName;
}

objectMapper.writeValueAsString(MyObject.builder().objectName("name").build());

Expected behavior
The output should be {"objectName":"name"}

Version info (please complete the following information):

  • Lombok version 1.8.22
  • All platforms

Additional context
I'm migrating from Immutables which solves this by adding @JsonProperty to all of the Immutable object's fluent getters.

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