[Bitbucket Cloud] pullrequests pagination invalid URL (using each)
Using pullrequests.each() only works if the number of open pull requests fits in a single page (<=10). The first call (without a page number) works but the second call fails. Debug shows the following 2 calls
https://api.bitbucket.org:443 "GET /2.0/repositories/summitmedia/automotive-retail-frontend/pullrequests/ HTTP/1.1" 200 None https://api.bitbucket.org:443 "GET /2.0/repositories/summitmedia/automotive-retail-frontend/pullrequests/?page=2/ HTTP/1.1" 400 55
The problem is the trailing slash is added to the end of the URL giving the invalid page number, ie 2/
The value of next being returned from the first call is correct. The each method sets trailing=True and this causes the trailing slash to be added on subsequent calls. I think either not setting this to true or having _get_paged set trailing=False if there is next value (similar to how it sets absolute=True) would fix it.
@gonchik This can be closed.
Thank you @Spacetown :)
It seems that the issue still persists This is what I get when trying to get PR's in Cloud via each(q='state="declined"') https://api.bitbucket.org/2.0/repositories/repo/project/pullrequests/?q=state+%3D+%22declined%22&page=2/