[DATACMNS-1309] Let work Pageable without query parameters Created: 02/May/18 Updated: 08/May/18 Resolved: 08/May/18
|Project:||Spring Data Commons|
|Affects Version/s:||2.0.6 (Kay SR6)|
|Reporter:||Manuel Jordan||Assignee:||Oliver Drotbohm|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
About the use of the PagingAndSortingRepository interface and the following configuration:
I am able to work in a @Controller with the following:
Thus through the following URL
I am able to change the page and size in peace through the query parameters. It thanks to the PageableHandlerMethodArgumentResolver class support too.
Just wondered why is not possible work around this way (URI path variables)
Sadly for both cases appears the HTTP Status 404 – Not Found
I know is not critical, but I think is more elegant to work without query parameters.
Even if it is through a Web Browser interaction through a html page, in the 5. Paging and Sorting section of the Spring Data REST project, is possible observe that for Rest works with query parameters. To be honest I thought that for rest and uri was only possible work around path variables.
|Comment by Oliver Drotbohm [ 08/May/18 ]|
That'd require a completely different implementation of the resolver which you can of course write yourself but we won't. Generally speaking, path segments are much more invasive to the URI space we'd force on the users as they make up new resources. Pagination is basically limiting the output of a particular resource, which makes request parameters be the more natural choice.
|Comment by Manuel Jordan [ 08/May/18 ]|
Yes, I did a research. Is valid for Rest has these parameters (page, size and sort) because they represent 'filters' and they are not part of the Resource being retrieved.