Skip to content

Sort resource and search results #3

@donavon

Description

@donavon

I'd like to make a feature request. It would be nice if you could sort the results from a resource and a search. For example, search for https://swapi.dev/api/people/?search=a and you will get 58 results, but only the first 10 are returned. So any UI would likely display these items with a "next page" button. They appear to be sorted by ID, making the order of the pages meaningless, and even a bit confusing to the user.

I'd like to see something like ?sort=[name:asc, hair_color:desc] (ie. sort first by name in ascending order, then by hair color in descending order).

Or at a very minimum sort=asc, which would sort by the "main" field in ascending order. The "main" field would likely be name or title.

If this were JavaScript, I'd submit a PR myself.

Thought?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions