Implement pagination in 'Get list of entities' requests
Closed this issue · 3 comments
KhusainovFarrukh commented
Implement pagination in 'Get list of entities' requests
Hamdam23 commented
Let's talk about what should I return on response.
If response details on the picture is fine, I'll implement the logic to entire project.
An interesting repo:
https://github.com/bezkoder/spring-boot-jpa-paging-sorting
KhusainovFarrukh commented
Let's talk about what should I return on response. If response details on the picture is fine, I'll implement the logic to entire project.
I think it's ok, but I suggest removing separate 'pageable' JSON object for page details. You can write page details directly on parent JSON object:
{
"items": [ ],
"page": 3,
"next_page": 4,
"prev_page": 2,
"total_items": 47,
"total_pages" : 5,
"page_size": 10
}