spring-projects / spring-projects/spring-data-commons

one-indexed-parameters must impact PageableHandlerMethodArgumentResolverSupport.getDefaultPageRequestFrom(...)

Open
#3,483 4 comments 0 reactions 1 assignee View on GitHub

@mp911de is already working on this.

Since Jun 1, 2026.

status: waiting-for-triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.