Support Slice in the PagedResourcesAssembler [DATACMNS-845]
See original GitHub issueOliver Drotbohm opened DATACMNS-845 and commented
From the original ticket in Spring HATEOAS:
Sometimes we cannot have information such as the total elements and total pages of a request, that’s where we’re using a
Slice
instead of aPage
. But thePagedResourcesAssembler
does not allow to convert aSlice
to aResource
. It would be great to add atoResource(Slice<T> entity)
method, or even addSlicedResourcesAssembler
class.
Reference URL: https://github.com/spring-projects/spring-hateoas/issues/443
2 votes, 4 watchers
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to correctly use PagedResourcesAssembler from Spring ...
So the PagedResourcesAssembler will take a Spring Data Page instance ... Your model classes can inherit some class with pagination support:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As a workaround it should be possible to issue repository methods returning a
Slice
and adding navigation links pointing to the previous and potentially next slice manually. Wouldn’t mind to see such code wrapped into aSliceRepresentationModelAssembler
effectively producing aCollectionModel<T>
with the aforementioned links added in a pull request.You’re right, will look into it 👍