Gitlab API bug - does not return more than 1000 changed files

There is a problem in the limitations of getting modified files in commit via the gitlab api. When there are more than 1000 modified files in a commit, everything works fine until we get past 1000 files.

For example, the result of a query like https://gitlab.com/api/v4/projects/{id}/repository/commits/{commit_id}/diff?id={id}&page=9&per_page=100 works fine and returns the headers 'X-Next-Page': '10', 'X-Page': '9', 'X-Per-Page': '100', 'X-Prev-Page': '8'

For the request https://gitlab.com/api/v4/projects/{id}/repository/commits/{commit_id}/diff?id={id}&page=10&per_page=100 all files are also returned correctly, but the headers are 'X-Next-Page': '', 'X-Page': '10', 'X-Per-Page': '100', 'X-Prev-Page': '9', i.e. the next page does not exist.

And finally when we send a request to https://gitlab.com/api/v4/projects/{id}/repository/commits/{commit_id}/diff?id={id}&page=11&per_page=100 an empty value is returned. Although there are more than 1000 changed files. The problem is not in the X-total-pages limitation, because if you set per-page = 50 or other number, X-total-pages will increase, but exactly until the files are not more than 1000.

Edited by 🤖 GitLab Bot 🤖