[rest-practices] Pagination API

Bill Burke bburke at redhat.com
Mon Jul 26 13:58:13 UTC 2010


I agree namespace it if you have to.

paging.limit paging.start

David Lutterkort wrote:
> On Thu, 2010-07-22 at 13:08 -0700, Kent Watsen wrote:
>> ABNF Syntax:
>>
>>   "paging=(" ["start=" 1*DIGIT ","] "limit=" 1*DIGIT ")"
>>
>> Notes:
>>
>>     * Returns at most "limit" items, starting with the "start" item in the collection
>>     * "0" is the default <start> value used when none is specified
>>     * Paging is over live data; elements may shift over the course of multiple requests
>>
>> Examples:
>>
>>     * paging=(limit=25)
>>     * paging=(start=0,limit=25)
> 
> What's the reason for having a special format within the query
> parameter ? That forces the client to do extra work if they want to jump
> to item 42 (rather than just tacking '?start=42&limit=25' at the end of
> the URL)
> 
> I would just go with parameters 'page', 'limit', and 'order' (addressing
> per-page, rather than per-item, seems simpler to me, with counting pages
> from 1), i.e. something like
> '/index?page=5&limit=10&order=name,modified_at.desc,color.asc'
> 
> David
> 
> 
> _______________________________________________
> rest-practices mailing list
> rest-practices at redhat.com
> https://www.redhat.com/mailman/listinfo/rest-practices

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com




More information about the rest-practices mailing list