Open fespinoza opened 9 years ago
I much prefer this approach to having, say, data
and meta
objects in the JSON eveywhere. :+1: from me!
I would actually prefer adhering to RFC 7233 for pagination. It provides multiple headers and is a different approach to pagination than just “pages”. It also looks a lot better in the headers, in my opinion. Super simple to set up using Rails with the clean_pagination gem as well.
Have a look at how we did this in HyperAdmin: https://github.com/hyperoslo/hyper_admin/commit/4da49c000d388da593a4cea2327f5da53ec9ec43
https://developer.github.com/v3/#pagination
http://tools.ietf.org/html/rfc5988
this is the way github handles pagination on their APIs, they use pagination in the url as query parameter, then use the
Link
header to inform the next page url and the previous page as well