[API] Get organizations API's limit parameter not working #4818

Closed
opened 2025-11-02 06:03:42 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @pd4d10 on GitHub (Feb 9, 2020).

Description

Get organizations API's limit parameter seems not working. It always returns all organizations, which can be reproduced in https://try.gitea.io/api/swagger#/

I'm working on a Gitea mobile client and find this issue.

Thanks!

Originally created by @pd4d10 on GitHub (Feb 9, 2020). - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) ## Description Get organizations API's limit parameter seems not working. It always returns all organizations, which can be reproduced in https://try.gitea.io/api/swagger#/ I'm working on a [Gitea mobile client](https://github.com/pd4d10/git-touch) and find this issue. Thanks!
GiteaMirror added the type/questionmodifies/api labels 2025-11-02 06:03:42 -06:00
Author
Owner

@6543 commented on GitHub (Feb 9, 2020):

@pd4d10 it is working as expected: https://try.gitea.io/api/v1/orgs?page=1&limit=5

@6543 commented on GitHub (Feb 9, 2020): @pd4d10 it is working as expected: `https://try.gitea.io/api/v1/orgs?page=1&limit=5`
Author
Owner

@6543 commented on GitHub (Feb 9, 2020):

can confirm that https://try.gitea.io/api/v1/orgs?limit=5 is not working ...

@6543 commented on GitHub (Feb 9, 2020): can confirm that `https://try.gitea.io/api/v1/orgs?limit=5` is not working ...
Author
Owner

@6543 commented on GitHub (Feb 9, 2020):

this is intended:

74a4a1e17f/models/user.go (L1601-L1603)

just send a page number if you like paggination

@6543 commented on GitHub (Feb 9, 2020): this is intended: https://github.com/go-gitea/gitea/blob/74a4a1e17f99d147db9329718a5ecc87984b0ecd/models/user.go#L1601-L1603 just send a page number if you like paggination
Author
Owner

@6543 commented on GitHub (Feb 10, 2020):

@pd4d10 if you got it working - can you close this issue?

@6543 commented on GitHub (Feb 10, 2020): @pd4d10 if you got it working - can you close this issue?
Author
Owner

@pd4d10 commented on GitHub (Feb 11, 2020):

After page param added it works. Thanks for the quick response!

@pd4d10 commented on GitHub (Feb 11, 2020): After page param added it works. Thanks for the quick response!
Author
Owner

@pd4d10 commented on GitHub (Feb 22, 2020):

Hi, @6543 , it works with the page query added. But the response header seems to lack x-page, x-hasmore and x-total.

Could you help to check this? Thanks!

@pd4d10 commented on GitHub (Feb 22, 2020): Hi, @6543 , it works with the `page` query added. But the response header seems to lack `x-page`, `x-hasmore` and `x-total`. Could you help to check this? Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4818