My team recently adopted the json api convention. In the documentation for the api sorting is not addressed.
They do however address filtering in the recommendations page but in my opinion, sorting is not part of filtering since filtering is used to reduce a set while sorting is used to re-order a set.
Given the json api convention, I'd like to know:
- Should sorting be the responsibility of the api or the client?
- If it should be the responsibility of the api, are there any guidelines for structuring the url to handle sorting?
Sorting is actually documented on the website: http://jsonapi.org/format/#fetching-sorting
Short summary:
sort
as the parameter namesort=lastname,forename
sort=-lastname,forname
), the default order is ascending