Skip to content

sort filter in crud_router for auto-generating endpoints #230

@mohit-chaniyal

Description

@mohit-chaniyal

Is your feature request related to a problem? Please describe.

When using the crud_router for auto-generating endpoints, I noticed that while pagination and filtering are supported, there is currently no built-in way to sort the results. This makes it difficult to order query results by fields like created_at, username, or any other attribute, which is a common need in APIs.

Describe the solution you'd like

I'd like to request native support for sorting query results via query parameters in the read method of crud_router. For example:
GET /users?sort=created_at
GET /users?sort=-username # descending

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions