RE: Call for consensus for the pagination design (ISSUE-42)

On 20 Okt 2015 at 02:20, elf Pavlik wrote:
> On 10/18/2015 09:18 PM, Markus Lanthaler wrote:
>> The representation of a specific view on a collection would look somewhat
>> like this with the new proposed design:
>> 
>>   {
>>     "@id": "http://api.example.com/an-issue/comments",
>>     "@type": "Collection",
>>     "member": [ ... ],
>>     "totalItems": 150,
>>     "view": {
>>       "@id": "/an-issue/comments?page=3",
>>       "@type": "PartialCollectionView",
>>       "first": "/an-issue/comments",
>>       "previous": "/an-issue/comments?page=2",
>>       "next": "/an-issue/comments?page=4",
>>       "last": "/an-issue/comments?page=498",
>>     }
>>   }
> 
> 1)
> I understand that we look at response to
> GET /an-issue/comments?page=3

Correct.


> and responses to any other page= will just differ with values 'inside'
> of view object and elements 'inside' of members array. so always
> repeating "@id": "http://api.example.com/an-issue/comments" in the
> 'root' object

Exactly


> 2)
> 
> "first": "/an-issue/comments"
> since it has "@type": "Collection"
> 
> 
> shouldn't we use instead
> 
> "first": "/an-issue/comments?page=1"
> which would have "@type": "PartialCollectionView"

I think both should be considered to be valid, but we should discuss this. I
think the latter would indeed be better.


> 3)
> 
> what exactly we will get in response to
> GET /an-issue/comments
> 
> especially what @id of the view

Generally speaking that's up to the server, but following the spirit of the
example, it would be view /an-issue/comments?page=1



--
Markus Lanthaler
@markuslanthaler

Received on Tuesday, 20 October 2015 19:47:26 UTC