I'm currently building a REST API in which I want clients to easily filter on most properties of a specific entity. Using QueryDSL in combination with Spring Data REST (an example by Oliver Gierke) allows me to easily get to 90% of what I want by allowing clients to filter by combining query parameters which refer to properties (e.g. /users?firstName=Dennis&lastName=Laumen
). (If you're using the same integration Oliver Gierke's answer to my previous question might also help.)
Unfortunately, when using the additional filters QueryDSL provides, like firstName=Dennis&lastName=Laumen
, these do not seem to integrate with the pagination features of Spring Data REST. The pagination links when GET
ting a collection resource return links which ignore the applied filters (e.g. http://localhost:8080/api/users?page=1&size=20
instead of http://localhost:8080/api/users?page=1&size=20&firstName=Dennis&lastName=Laumen
).
Concluding, is it possible to display the correct pagination links when using Spring Data REST and QueryDSL? If so, how?