spring-projects / spring-projects/spring-data-commons
one-indexed-parameters must impact PageableHandlerMethodArgumentResolverSupport.getDefaultPageRequestFrom(...)
@mp911de is already working on this.
Since Jun 1, 2026.
- Dominant language
- Java
- Stars
- 838
- Forks
- 730
- PR merge metrics
- No merged PRs in 30d
Description
when activating the one indexed pageable parameter
spring:
data:
web:
pageable:
one-indexed-parameters: true
Any request with the page http parameter will get it value reduced by 1. ?page=5 become page=4 in pageable method parameter.
However, if the http parameter is missing, defaults values applies page=0.
If we add the @PageableDefault(page = 1), default value will be 1.
When using OpenAPI generator, specs like below
parameters: - name: page required: true in: query schema: type: integer default: 1 minimum: 1
will generate @PageableDefault(page = 1) which is wrong in HTTP request point of view.
The implementation of the PageableHandlerMethodArgumentResolverSupport.getDefaultPageRequestFrom(...) must take into account the one-indexed-parameters.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.