/api/v1/repos/{o}/{repo}/labels does not apply pagination consistently #9560

Open
opened 2025-11-02 08:42:58 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @noerw on GitHub (Sep 13, 2022).

Description

  1. Pagination is not applied by default (is there a need for this wrt backwards compat?)
  2. Pagination is only applied when &page= param is set, setting &limit= is not enough.

This behaviour is inconsistent with other APIs.
Try the following examples. The example repo currently has 91 labels:

See also #16733.
This problem originally came up in: https://gitea.com/gitea/tea/issues/463

Gitea Version

1.18.0+dev-333-g9e0c43777 (9e0c43777)
but the bug is much older than that.

Originally created by @noerw on GitHub (Sep 13, 2022). ### Description 1. Pagination is not applied by default (is there a need for this wrt backwards compat?) 2. Pagination is only applied when `&page=` param is set, setting `&limit=` is not enough. This behaviour is inconsistent with other APIs. Try the following examples. The example repo currently has 91 labels: - https://gitea.com/api/v1/repos/lunny/gitea/labels - 91 results, questionable if `MAX_RESPONSE_ITEMS = 50`, but probably for backwards compat reasons. - https://gitea.com/api/v1/repos/lunny/gitea/labels?limit=60&page=1 - 50 results, reasonable if `MAX_RESPONSE_ITEMS = 50` - https://gitea.com/api/v1/repos/lunny/gitea/labels?limit=60 - 91 results, certainly wrong - https://gitea.com/api/v1/repos/lunny/gitea/labels?page=1 - 30 results, reasonable if `DEFAULT_PAGING_NUM = 30`, though strange UX See also #16733. This problem originally came up in: https://gitea.com/gitea/tea/issues/463 ### Gitea Version 1.18.0+dev-333-g9e0c43777 (9e0c43777) but the bug is much older than that.
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 08:42:58 -06:00
Author
Owner

@lunny commented on GitHub (Jun 21, 2023):

The problem is the page parameter, its default value is 0 which means don't have pagination.

@lunny commented on GitHub (Jun 21, 2023): The problem is the page parameter, its default value is 0 which means don't have pagination.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9560