[go: up one dir, main page]

Skip to content

pagination with REST API for commits doesn't work as expected

The REST API for commits (e.g. GET /projects/:id/repository/commits) defaults to starting at page 0 and not page 1 as expected

For example, calling without any parameters should and does retrieve the 20 most recent commits: GET /projects/:id/repository/commits

However, the expectation is that the page retrieved is page 1, so the next 20 commits are expected to be retrieved as such: GET /projects/:id/repository/commits?page=2

But the original call was actually retrieving page 0: GET /projects/:id/repository/commits?page=0

So calling with page=2 above skips the second set of twenty and retrieves the next instead.

This same problem may affect the REST API for projects as well, as that code seems to start with page 0 as well, but I haven't had a chance to fully test that.