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

Pageable inconsistent with hateoas pagemetadata int/long

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

@odrotbohm is already working on this.

Since Aug 12, 2024.

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

Description

I just noticed that the spring data interface pageable uses int for page number and page size, but the PageMetaData from the PagedModel in spring hateoas uses long for size, totalElements, totalPages and number.

This makes in unnecessary hard to combine both paging approaches within the spring libs.
In terms of expected values it won't be a problem to simply cast, one to the other, because you seldom would have more pages than max_int.
Nevertheless, this would be good to harmonize.

This is why I created the issue here, because it should be better to upgrade ints to long, than reduce the long to int. (even though it should hopefully not lead to errors)

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.