Skip to content

REST API /api/v1/admin/users?source_id=1 does not work #28475

@khmarbaise

Description

@khmarbaise

Description

The given REST API end point does not give back anything.

root@Debian-bullseye-latest-amd64-base ~ # curl -H "Authorization: token XXXXXXX"  http://localhost:3000/api/v1/admin/users?source_id=1
[]

But If I use ?sourceid=1 instead I got the following:

 curl -H "Authorization: token XXXX"  http://localhost:3000/api/v1/admin/users?sourceid=1
[{"id":1,"login":"administrator","login_name":"","full_name":"Administrator","email":"giteaadmin@soebes.team","avatar_url":"https://secure.gravatar.com/avatar/XXXXXX?d=identicon","language":"en-US","is_admin":true,"last_login":"2023-12-10T16:13:38Z","created":"2023-08-27T11:58:59Z","restricted":false,"active":true,"prohibit_login":false,"location":"","website":"","description":"","visibility":"private","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"administrator"},{"id":3,"login":"khmarbaise","login_name":"","full_name":"Karl Heinz Marbaise","email":"khmarbaise@gitea.soebes.team","avatar_url":"https://gitea.soebes.team/avatars/XXXXX","language":"en-US","is_admin":false,"last_login":"2023-12-06T19:29:26Z","created":"2023-11-10T19:57:30Z","restricted":false,"active":true,"prohibit_login":false,"location":"","website":"","description":"","visibility":"private","followers_count":0,"following_count":0,"starred_repos_count":0,"username":"khmarbaise"}]

That mean in consequence the generate API documentation https://server/api/swagger is wrong.

Gitea Version

1.21.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

2.40.1

Operating System

Linux Debian-bullseye-latest-amd64-base 5.10.0-26-amd64 #1 SMP Debian 5.10.197-1 (2023-09-29) x86_64 GNU/Linux

How are you running Gitea?

Running inside Docker container.

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions