GitLab GET tags API returns a "x-next-page" response header even though there is no more resources to fetch

Problem to solve

The REST API for getting tags in a project i.e.GET /projects/:id/repository/tags should not return an x-next-page header when there are no more resources to fetch

Expected Behaviour
The GET tags API should not return the x-next-page header
Current Behaviour
The GET tags API returns the x-next-page header

Steps to reproduce

  • Create 2 tags in a project

  • Call the GET tags in a project API with per_page 20 and page 1. i.e. GET /projects/:id/repository/tags?per_page=20&page=1

  • The API returns x-next-page with a value of 2 in the response headers

Configuration

A project having 2 tags

Versions

Please select whether options apply, and add the version information.

Versions

Any help would be much appreciated on this

That is something returned by the application, so that cannot be turned off. I suggest open an issue here: Issues · GitLab.org / GitLab · GitLab so that the Gitlab Devs can look at it, and restrict it from appearing when there is only data for one page.

It won’t get resolved by just a forum post unfortunately, since Gitlab Devs don’t tend to read forum posts. They work on issues that have been opened.

Thanks for that. Issue raised.

1 Like