Web Services API for Organisations Returns Empty JSON Object #3482

Closed
opened 2025-11-02 05:14:22 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @netlander on GitHub (Jun 17, 2019).

  • Gitea version (or commit ref): 1.8.1
  • Git version: Not sure
  • Operating system: Ubuntu Server 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When using the swagger generated WebServices API to access the installation there is one end point that returns an empty JSON object.

Other end points such as for fetching users work as intended but haven't tested many end points yet.

This could be a bug or am I missing something?

Screenshots

image

Originally created by @netlander on GitHub (Jun 17, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.8.1 - Git version: Not sure - Operating system: Ubuntu Server 16.04 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description When using the swagger generated WebServices API to access the installation there is one end point that returns an empty JSON object. Other end points such as for fetching users work as intended but haven't tested many end points yet. This could be a bug or am I missing something? ## Screenshots ![image](https://user-images.githubusercontent.com/4721044/59626892-e9e5f700-9134-11e9-9591-8274d3e704ea.png)
GiteaMirror added the type/questionissue/stale labels 2025-11-02 05:14:22 -06:00
Author
Owner

@techknowlogick commented on GitHub (Jun 17, 2019):

can the user whose token you are using access the admin portal?

@techknowlogick commented on GitHub (Jun 17, 2019): can the user whose token you are using access the admin portal?
Author
Owner

@netlander commented on GitHub (Jun 18, 2019):

Yes they can, it's the admin.
Edit:
Can anyone confirm that it's a bug and whether an upgrade will fix the problem.
Many thanks

@netlander commented on GitHub (Jun 18, 2019): Yes they can, it's the admin. Edit: Can anyone confirm that it's a bug and whether an upgrade will fix the problem. Many thanks
Author
Owner

@stale[bot] commented on GitHub (Aug 22, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Aug 22, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@netlander commented on GitHub (Aug 22, 2019):

No one on the dev team bothered give an answer one way or the other. This does not reflect well on the project as a whole. Maybe a return to GOGS is in order.

@netlander commented on GitHub (Aug 22, 2019): No one on the dev team bothered give an answer one way or the other. This does not reflect well on the project as a whole. Maybe a return to GOGS is in order.
Author
Owner

@guillep2k commented on GitHub (Aug 23, 2019):

Just to get more info.... have you tried using the example curl command that appears in the swagger interface? I must be surely doing something wrong, but even if I go and use the Authorize button top-right of the page, I get 401 Unauthorized. However, if I use the curl command that appears right below the test section as an example (copy-pasted) it worked correctly:

$ curl -X GET "https://____my_site_____/api/v1/admin/orgs" -H  "accept: application/json" -H  "authorization: Basic xxxxx_base64_value_xxxxxx"
[{"id":6,"username":"MyOrg","full_name":"My Organization","avatar_url":"https://____my_site_____/avatars/7a25c586044ba7e85e47b73326421f2e","description":"","website":"http://____my_site_____/","location":"My City","visibility":"public"}]

Also, adding -v to the curl command will help you diagnose the problem. At least you'll get the headers back and see if it's indeed an empty response (e.g. HTTP/1.1 200 OK, Content-Length: 0) or another error.

@guillep2k commented on GitHub (Aug 23, 2019): Just to get more info.... have you tried using the example `curl` command that appears in the swagger interface? I must be surely doing something wrong, but even if I go and use the `Authorize` button top-right of the page, I get `401 Unauthorized`. However, if I use the `curl` command that appears right below the test section as an example (copy-pasted) it worked correctly: ``` $ curl -X GET "https://____my_site_____/api/v1/admin/orgs" -H "accept: application/json" -H "authorization: Basic xxxxx_base64_value_xxxxxx" [{"id":6,"username":"MyOrg","full_name":"My Organization","avatar_url":"https://____my_site_____/avatars/7a25c586044ba7e85e47b73326421f2e","description":"","website":"http://____my_site_____/","location":"My City","visibility":"public"}] ``` Also, adding -v to the `curl` command will help you diagnose the problem. At least you'll get the headers back and see if it's indeed an empty response (e.g. `HTTP/1.1 200 OK`, `Content-Length: 0`) or another error.
Author
Owner

@stale[bot] commented on GitHub (Oct 22, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Oct 22, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Nov 5, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Nov 5, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3482