.. currentmodule:: flask_rest_jsonapi
You can sort results with querystring parameter named "sort"
Note
Examples are not urlencoded for a better readability
Example:
GET /persons?sort=name HTTP/1.1
Accept: application/vnd.api+json
You can sort on multiple fields like that:
GET /persons?sort=name,birth_date HTTP/1.1
Accept: application/vnd.api+json
You can make desc sort with the character "-" like that:
GET /persons?sort=-name HTTP/1.1
Accept: application/vnd.api+json
Of course, you can combine both like that:
GET /persons?sort=-name,birth_date HTTP/1.1
Accept: application/vnd.api+json