Skip to content

[BUG] Transient properties in classes with @Jacksonized @Accessors(fluent=true) get serialized #3936

@renedewaele

Description

@renedewaele

Describe the bug
When creating a class with @Accessors(fluent = true) and @Jacksonized that contains transient fields, they inadvertently get serialized since v1.18.40.

To Reproduce
Class:

@Value
@Builder
@Jacksonized
@Accessors(fluent = true)
public class Foo {
    String foo;
    transient String transientFoo;
}

results in:

@JsonDeserialize(
    builder = FooBuilder.class
)
public final class Foo {
    @JsonProperty("foo")
    private final String foo;
    @JsonProperty("transientFoo")
    private final transient String transientFoo;

    ...
}

Expected behavior
Transient fields should not get @JsonProperty.

Version info (please complete the following information):
Since v1.18.40 on all platforms

Additional context
Probably caused by: #3860

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