-
Notifications
You must be signed in to change notification settings - Fork 472
Pageable not generated when link to method with Pageable param #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think this relates to spring-projects/spring-data-commons#2168 |
Today, Therefore, I think we are missing an SPI for |
Hi, any update on this? |
I found a workaround where I declare @GetMapping
public CollectionModel<?> get() {
return CollectionModel.empty().add(
linkTo(methodOn(this.getClass()).getPage(null, null, null, null, null)).withRel("pageable"));
}
@GetMapping("/page")
public ResponseEntity<PagedModel<?>> getPage(
@RequestParam(defaultValue = "0", required = false) Integer page,
@RequestParam(defaultValue = "10", required = false) Integer size,
@RequestParam(defaultValue = "UNSORTED", required = false) String sort,
Pageable pageable,
PagedResourcesAssembler<?> pagedResourceAssembler) {
return new ResponseEntity<>(service.findAll(pageable, pagedResourceAssembler), HttpStatus.OK);
} The workaround ends up giving me what I'm looking for: {
"_links": {
"pageable": {
"href": "http://localhost:8080/api/page{?page,size,sort}",
"templated": true
}
}
} |
Given
Link to findAllWithPagnation() in search mapping(below)
Self link returned in the finallAll gets generated fine with first, next, last etc, however
/search would render
Was Expecting
The text was updated successfully, but these errors were encountered: