spring-projects / spring-projects/spring-data-rest

Paging and sorting missing header meta data [DATAREST-101]

Open
#484 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

Raul Vieira opened DATAREST-101 and commented

I'm not able to determine the total count or total number pages using the PagingAndSortingRepository. According to the wiki I would expect to receive these headers:

x-springdata-meta-total-count: 125
x-springdata-meta-current-page: 1
x-springdata-meta-total-pages: 7

What I do receive is page data in my JSON response that looks like this:

...
"page" : {
"size" : 2,
"totalElements" : 4,
"totalPages" : 2,
"number" : 2
}
...


Reference URL: https://github.com/SpringSource/spring-data-rest/wiki/Paging-and-Sorting

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.

Research direction

Start with the Paging and Sorting wiki reference and the code that builds the PagingAndSortingRepository response. Reproduce the reported response and trace whether the documented x-springdata-meta-* headers are emitted; done means the headers expose total count, current page, and total pages consistently with the page metadata, with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.