Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

[BUG] Missing properties using @Accessors(fluent = true) in Jackson 3.0.3 #4004

Closed

Description

@giacgbj

The following behavior changed migrating from Jackson 2.20.1 to 3.0.3. I'm using Lombok 1.18.42 and I know it's not officially supported by Jackson.

Using @Accessors(fluent = true) causes missing properties.

Let's start with a working example.

I have this class which uses Lombok annotations:

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class Foo {
    private String a;
    private String b;

    @JsonCreator
    public Foo(@JsonProperty("a") final String a, @JsonProperty("b") final String b) {
        this.a = a;
        this.b = b;
    }
}
@Test
void testJacksonMigration() throws Exception {
    final Foo foo = new Foo("1", "2");

    final JsonMapper jsonMapper = JsonMapper.builder().build();
    final String json = jsonMapper.writeValueAsString(foo);
    System.out.println(json);
}

prints correctly {"a":"1","b":"2"}.

If I add to Foo class "@Accessors(fluent = true)" with Jackson 3 it doesn't work anymore, so:

[...]
import lombok.experimental.Accessors;

@Data
@Accessors(fluent = true)
public class Foo {
[...]

the test prints {}.

As a workaround, I added to each field a redundant @JsonProperty, but it works also with @JsonFormat, and probably any Jackson annotation.

Activity

  1. janrieke commented on Jan 21, 2026

    @janrieke
    Contributor

    I wonder why this works in Jackson 2 in the first place. It should not. Anyway, this is not a Lombok thing, it is a behavior change (probably intended) on Jackson's side.
    Try adding @Jacksonized to the class. That should work for both Jackson 2 and 3.

  2. giacgbj commented on Jan 22, 2026

    @giacgbj
    Author

    @janrieke it works because it adds @JsonProperty on each field, which is the same as the workaround I found. However, it emits a warning because, as per documentation:

    It only has an effect if present at a context where there is also a @builder or a @SuperBuilder a warning is emitted otherwise

  3. janrieke commented on Jan 22, 2026

    @janrieke
    Contributor

    It should not show that warning. Could you post the code that causes this warning?

  4. giacgbj commented on Jan 22, 2026

    @giacgbj
    Author

    It should not show that warning. Could you post the code that causes this warning?

    @janrieke sorry, I meant in the IDE. In IntelliJ IDEA:

    Image
  5. feeeedox commented on Feb 18, 2026

    @feeeedox

    It should not show that warning. Could you post the code that causes this warning?

    @janrieke sorry, I meant in the IDE. In IntelliJ IDEA:
    Image

    Image

    @janrieke

    Same here!
    But it's just the warning, the code is working fine after adding that.

  6. janrieke commented on Feb 18, 2026

    @janrieke
    Contributor

    Is this still an issue with the latest edge release?

  7. feeeedox commented on Feb 19, 2026

    @feeeedox

    Is this still an issue with the latest edge release?

    Image

    Yep the warning is still there.

  8. mandrean commented on Feb 23, 2026

    @mandrean
    Contributor

    Hi, I took a shot at this. Well partially, when used together with @Jacksonized. See #4014

  9. rzwitserloot commented on Apr 21, 2026

    @rzwitserloot
    Collaborator

    Fix is in, we'll push a release soon.

  10. added a commit that references this issue on Apr 21, 2026
  11. feeeedox commented on Apr 22, 2026

    @feeeedox

    Fix is in, we'll push a release soon.

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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