I have a controller with method, which returns PagedResource, which looks like this:
@RequestMapping(value = "search/within", method = RequestMethod.POST)
public @ResponseBody PagedResources within(@RequestBody GeoJsonBody body,
Pageable pageable, PersistentEntityResourceAssembler asm) {
// GET PAGE
return pagedResourcesAssembler.toResource(page, asm);
}
Now, I want to add that method as a link to the root resource, so I do the following:
public RepositoryLinksResource process(RepositoryLinksResource repositoryLinksResource) {
repositoryLinksResource.add(linkTo(methodOn(ShipController.class).within(null, null, null)).withRel("within"));
return repositoryLinksResource;
}
Which works and I get my link, however it add that link without pagination parameters. So it look like this:
"within": {
"href": "http://127.0.0.1:5000/search/within"
},
and I want to turn it into:
"within": {
"href": "http://127.0.0.1:5000/search/within{?page, size}"
},
This previous question on stackoverflow suggests that after fixing the corresponding issue on GitHub it should work by default, however, it doesn't.
What am I doing wrong ?