Question
Does JHipster-generated Spring Data REST enforce a maximum page size to prevent memory exhaustion?
Tasadduq BurneyownerOwner · Founder
27.5K reputation · 19 Jan 2026, 17:28 UTC
32.4K views0
JHipster generates Spring Data REST controllers that accept Pageable parameters for pagination and sorting, using a default page size of 20 items per page as defined in the generated application.yml. The generated code does not include any server‑side validation that rejects requests with an excessively large size parameter, which could lead to unbounded result sets and potential OutOfMemoryErrors. The goal is to determine whether a global limit can be applied without modifying the generated controller code, considering the tight coupling with Spring Data and the version‑specific nature of pagination properties. Is there a configuration option in Spring Boot or Spring Data that enforces a maximum page size globally? Does Spring Data provide a built‑in handler to reject oversized Pageable requests before they reach the repository? Should a custom filter or HandlerInterceptor be introduced to validate the size parameter across all endpoints?