[almighty] Pagination & jsonapi.org
Thomas Mäder
tmader at redhat.com
Mon Oct 3 12:42:13 UTC 2016
Hi folks,
I'm in the middle of solving
https://github.com/almighty/almighty-core/issues/329 . Jsonapi.org has
some recommendations about this:
http://jsonapi.org/format/#fetching-pagination.
What they recommend is adding "next", "prev" and "last" links to a
"links" object on the top level of the response document. The client
then must compute how many pages there are and the size of the pages by
parsing the uri's.
This seems wrong to me: I expect the front end to always limit the
result set anyway. In this case, returning the total count seems much
simpler to me for both the back end and clients. The count could be
returned as a header or as a filed in the result json object.
Opinions (especially of our consumers) would be appreciated.
/Thomas
More information about the almighty-public
mailing list