spring - REST sort descending with minus ('-') symbol, rather than <propertyName>.dir=desc -


i'm trying out spring data mongodb , rest shown here. 1 thing noticed sort results, add query parameter named .dir value of "asc" or "desc".

in many rest apis i've used, mechanism sorting put minus ("-") symbol in front of property name in sort (or order) parameter.

is there way customize spring allow behavior?

i remembered stumbled on thread before made customized resolver. can use simplesorthandlermethodargumentresolver class on https://github.com/sancho21/spring-data-commons/commit/6c90a9cfcb50b2ed0e7a25db0cfd64d36e7065da

please comment support adoption on https://github.com/spring-projects/spring-data-commons/pull/166/files

as reminder, in order use class, need inject instance of existing constructor of existing pageablehandlermethodargumentresolver instance.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -