Why is isLastPage false but no nextPageStart?

I am using the following url:

https://stash.corp.netflix.com/rest/api/1.0/projects/ENGTOOLS/repos/odin/commits/?since=8992ee6b49a941c5a08b4a1ec085444bf28e6e7a&until=e42d17ff3ee5d2f3fdb9bfb44fe2df878a1170e8&limit=4

Without the limit this query would return 15 values (and isLastPage equals true). With limit=4 I get four values and:

"size": 4,"limit": 4,"isLastPage": false,"start": 0

Notice that isLastPage is false, but no nextPageStart is provided. The documentation says, "If more than one page exists (i.e. the response contains "isLastPage": false), the response object will also contain a nextPageStart attribute", so why am I not getting a nextPageStart value?

BTW, I did some further experimenting: I get the nextPageStart value if I remove the 'since' parameter. That narrows down the problem, but I don't see any work around since I really do need to define a starting point and an ending point for the commits.

1 answer

1 accepted

0 votes
Accepted answer
Jason Hinch Atlassian Team Mar 24, 2013

Hi,

This is a bug in the Stash REST API due to an alternate paging implementation being used which doesn't expose the nextPageStart attribute. You can still build the next page request programatically based off the other information given in the response.

I've raised a bug to track the progress of fixing this inconsistency:

https://jira.atlassian.com/browse/STASH-3253

Thanks for the explanation.

As for building the next page programatically, the doc says:

Identifiers of adjacent objects in a page may not be contiguous, so the start of the next page is not necessarily the start of the last page plus the last page's size. A client should always use nextPageStart to avoid unexpected results from a paged API.

If that is true, I don't see how I can reliably build the the next page call?

Jason Hinch Atlassian Team Mar 24, 2013

This can be true for resources which provide filtering capabilities (such as filtering users by matching usernames). It is fine to do for the commits resource as a workaround for the bug raised

In that case, it will work for me. Thx.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

251 views 3 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you