Allow specifying null handling for 'sort' query params as well as setting a default #3152
Labels
status: ideal-for-contribution
An issue that a contributor can help us with
type: enhancement
A general enhancement
Hi,
a few years ago, the initial feature request was created to allow setting the null handling via the 'sort' query parameters.
In the mean time, this was picked up by jakartaee/persistence (jakartaee/persistence#76) and, as far as I can tell, there is progress made in getting this into spring-data-jpa for 3.4.0.
Following addition to the
@SortDefault
annotation could be made:Following addition to the sort query param could be made:
?sort=(propertyName)+(,ASC|,DESC)?(,ignorecase)?(,nullsnative|,nullsfirst|,nullslast)?
The null handling would be optional, and work in any combination with the remaining, optional parameters. A few, valid examples would be:
As the SortHandlerMethodArgumentResolverSupport is part of spring-data-commons, I opted to create the issue here again to have an issue number in this project, hope this was the right approach.
Edit: A draft PR implementing the suggestion can be found here: #3153. Happy to hear any suggestions you might have!
The text was updated successfully, but these errors were encountered: