micronaut-projects / micronaut-data

Ahead of Time Data Repositories
Apache License 2.0
465 stars 196 forks source link

Add the ability to define default pagination + sort properties for Pageable #966

Open ghillert opened 3 years ago

ghillert commented 3 years ago

As Micronaut provides the ability to handle io.micronaut.data.model.Pageable as a controller parameter, it would be useful to also add support for:

That way sensible defaults can be defined on a per-controller basis.

graemerocher commented 3 years ago

Note that these can already be globally defined here https://micronaut-projects.github.io/micronaut-data/latest/guide/configurationreference.html#io.micronaut.data.runtime.config.DataConfiguration.PageableConfiguration

Seems odd to want different behaviour per controller, but ok

MT-Jacobs commented 1 year ago

One reason we'd want this is if different controllers use different sort by fields. Granted, at that point, you're not running as much of a microservice...