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

PageableHandlerMethodArgumentResolverSupport still uses page, size as the default parameter names

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

@odrotbohm is already working on this.

Since Jul 8, 2024.

status: waiting-for-triage
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

According to https://github.com/spring-projects/spring-data-commons/pull/2882, AbstractPageRequest has been changed field names to

  • size -> pageSize
  • page -> pageNumber

This change has impact to any Page<?> response. but https://github.com/spring-projects/spring-data-commons/blob/main/src/main/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverSupport.java still uses

  • private static final String DEFAULT_PAGE_PARAMETER = "page";
  • private static final String DEFAULT_SIZE_PARAMETER = "size";

as a default params name, this may cause inconsistency.

Parameter names are changable using setPageParameterName, getPageParameterName but also be great default value is changed to

  • private static final String DEFAULT_PAGE_PARAMETER = "pageNumber";
  • private static final String DEFAULT_SIZE_PARAMETER = "pageSize";

as AbstractPageRequest was already been changed.

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.