Open GoogleCodeExporter opened 8 years ago
I will take a look into this issue.
Original comment by stoy...@gmail.com
on 21 Sep 2012 at 10:43
I was able to reproduce and fix the issue, see the attached patch. I also added
a unit test.
While testing, I noticed that there seems to be also this issue: next url with
a $skiptoken is generated even if the requested $top value is smaller than the
default maxResults, i.e. when running the InMemoryProducerTest and querying
http://localhost:8887/InMemoryProducerExample.svc/Integers?$top=1 that still
produces a next url: <link rel="next"
href="http://localhost:8887/InMemoryProducerExample.svc/Integers?$skiptoken=(0)"
/>. All other OData services I checked (Netflix, Northwind, etc.) don't do
this. Should this be fixed as well?
Original comment by stoy...@gmail.com
on 21 Sep 2012 at 2:50
Attachments:
Patch looks good. It's committed. Thanks.
Original comment by stephan....@googlemail.com
on 24 Sep 2012 at 10:07
I'm not sure if I did misunderstood the term maxResult. maxResults is the
maximum result-set that a server can return in one request. There are even more
results to return with next link and actually this means server side paging.
With client side paging it became more complicated and we have to consider the
cases where top > maxResult. Here is an use case:
result set: 20
maxResult: 8
top: 10
How will the next link after first request with top=10 look like?
Original comment by stephan....@googlemail.com
on 25 Sep 2012 at 12:49
When top > maxResult, the next link was generated with a long "top" value, as
reported in the issue. This is now fixed. In your example, before the fix it
would have been:
<link rel="next" href="...?$top=10&;$skiptoken=(7)" />
After the fix, it would be:
<link rel="next" href="...?$top=2&;$skiptoken=(7)" />
The other issue that I see is when top < maxResult. In this case, odata4j still
generates a next link, although I believe it shouldn't, and all other services
I tested don't do this as well.
Original comment by stoy...@gmail.com
on 30 Sep 2012 at 11:11
Original issue reported on code.google.com by
radhikab...@gmail.com
on 25 Nov 2011 at 12:42