Annotation Interface RestrictedPageable
Marks a
Pageable controller method parameter
as subject to field-level sorting restrictions.
When applied, the pageable argument is validated so that sorting is only
allowed on fields explicitly annotated with Sortable.
Validation behavior depends on WebQuery configuration on the same method:
- Entity-aware mode (
dtoClass = void.class): sort selectors are validated against entity fields and optionalFieldMappingaliases. - DTO-aware mode: sort selectors are validated against DTO fields and translated
to entity paths via
MapsTo.
This annotation does not affect pagination parameters
such as page number or page size. It only governs which fields may be used
in sort query parameters.
The validation is enforced by a custom
HandlerMethodArgumentResolver
before the controller method is invoked.
Example usage:
@GetMapping
@WebQuery(entityClass = User.class)
public Page<User> search(
@RestrictedPageable Pageable pageable
) {
...
}