Sort query parameter is getting splitted
Hello!
In my project I use Pageable for correct paging and sorting of response results:
@GetMapping(value = "/endpoint-with-pagination-support")
fun getPage(pageable: Pageable): Page<SomeDTO>
After updating to the latest version I noticed it stopped working correctly. Sort direction (ASC,DESC) isn't preserved anymore.
I debugged feign requests and noticed some query param expansion process, which was added in version 10.7.2 in this commit https://github.com/OpenFeign/feign/commit/a7b7c01806324126dd844a9a912e309754bc4dc9#diff-52499e1757ad7b3aeb1163f476846de3R190
I assume sort query parameter should be sort=name,DESC as it was before, but now it is sort=name&sort=DESC, so Spring looses the second part with direction.
This is due to our internal logic that separates query parameters using a , comma. This will be addressed in #1019.
Pageable has been troublesome for some time now. One way to manage this today is to use a Custom Expander to manage object.
Try my way ! @SpringQueryMap Pageable page
@maxqfz This has been fixed. In 10.12 the result of this is sort=name%2CDESC, which is an appropriate result given the comma should be encoded on the query string.