API pagination broken?

Hello,

I working with Gitea 1.11.5 and I’m playing with its API, and I think I’m facing a bug with the pagination mechanism.

I first played with the /repos/search route: according to Swagger documentation, there are page and limit parameters, So I expected to find some cookies or headers in Gitea answer to get the total number of pages and the current page, but I only get a X-Total-Count header, so I have to compute by myself the total number of pages.

Why not, but usually this information is returned by the server.

Ok, secondly I played with /orgs/{org}/repos route: again, according to Swagger documentation, there are page and limit parameters. But this is not working at all !

curl -v -H 'Authorization: token <my token>' 'http://127.0.0.1:3000/api/v1/orgs/<my orga>/repos?limit=5' | jq .[].name

This returns the following headers and cookies:
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=UTF-8
< Set-Cookie: lang=en-US; Path=/; Max-Age=2147483647
< Set-Cookie: i_like_gitea=1a0f5cbb5d1bdd3e; Path=/; HttpOnly
< Set-Cookie: _csrf=Ucpg8ilkcqXWa4D5f7d9QF_sBDY6MTU5MDY1MDE2NjE4MTg0MDkyNQ; Path=/; Expires=Fri, 29 May 2020 07:16:06 GMT; HttpOnly
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< Date: Thu, 28 May 2020 07:16:06 GMT
< Transfer-Encoding: chunked

And I get 12 projects enumerated (the total amount of projects in that organization)

So:

  1. limit parameter seems to be totally ignored
  2. I don’t even get a value in headers to get count of projects in organiszation.

I’m quite surpised with that, so am I missing something ?

Regards,

Eric