Annotation Interface RestrictedPageable


@Target(PARAMETER) @Retention(RUNTIME) @Documented public @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 optional FieldMapping aliases.
  • 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
 ) {
     ...
 }