question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Slice in the PagedResourcesAssembler [DATACMNS-845]

See original GitHub issue

Oliver 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 a Page. But the PagedResourcesAssembler does not allow to convert a Slice to a Resource. It would be great to add a toResource(Slice<T> entity) method, or even add SlicedResourcesAssembler class.


Reference URL: https://github.com/spring-projects/spring-hateoas/issues/443

2 votes, 4 watchers

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
odrotbohmcommented, Feb 11, 2021

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 a SliceRepresentationModelAssembler effectively producing a CollectionModel<T> with the aforementioned links added in a pull request.

1reaction
bigjoe-memooriacommented, Feb 12, 2021

You’re right, will look into it 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found