Skip to content

WarningMixing/WrappingMixing in PageModule overrides user defined Jackson annotations.  #3114

Open
@arvydzutis

Description

@arvydzutis

Encountered while migrating Spring Boot from 3.2.7 to 3.3.1.
If custom class has extended PageImpl, the annotations, such as @JsonIgnoreProperties, does not work because of WarningMixing or WrappingMixing is now registered.

@JsonIgnoreProperties(ignoreUnknown = true, value = {"pageable"})
public class RestPage<T> extends PageImpl<T> {
...
}

The only way to fix this is to override the mixin:

objectMapper.addMixIn(PageImpl.class, RestPageMixin.class);
public interface RestPageMixin {
    @JsonIgnore
    Pageable getPageable();
}

Is it a bug or should we move to PagedModel?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions