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.
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 bename
ortitle
.If this were JavaScript, I'd submit a PR myself.
Thought?