-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
Description
In the api models, there is no field other than the "full_name" field in the object that represents the organizations. This "full_name" field refers to the "Organization Full Name" field in the organization settings. However, the information requested in API queries is the information in the "Organization Name" field. And this information is one that cannot be retrieved with the current api model.
This causes an error in requests like "/orgs/{org}/hooks", "/orgs/{org}/members" etc if organization name and display name are different.
For example, if the organization name is Microsoft, the address of the request should be "/orgs/Microsoft/members", but since the organization's full name is Microsoft Inc, the address will be "/orgs/Microsoft%20Inc/members" and the response is as follows as an example.
{
"errors": [
"user redirect does not exist [name: microsoft inc]"
],
"message": "GetOrgByName",
"url": "https://try.gitea.io/api/swagger"
}
Gitea Version
1.17.2
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
Git Version
No response
Operating System
Windows Server 2022
How are you running Gitea?
Gitea binary applicaiton on Windows server with default configurations.
Database
MySQL
Activity
KN4CK3R commentedon Sep 18, 2022
username
should contain the value.ozgurceozturkce commentedon Sep 18, 2022
KN4CK3R, username is not available in organization api model. Where exactly should I put a username?
KN4CK3R commentedon Sep 19, 2022
It's in your screenshot. Third from bottom.
You don't call the API with the display name but the username.
ozgurceozturkce commentedon Sep 19, 2022
This is exactly what I was looking for. Thank you. But this information is not available in the documentation. As is known, there is no "username" field among model members in the documentation. In any case, I got my answer. Thanks for your attention. I'm closing the issue.
KN4CK3R commentedon Sep 19, 2022
Which documentation are you talking about?
ozgurceozturkce commentedon Sep 20, 2022
I'm sorry for the late reply.
What I want to say is the lack of information. Since the object name is "organization" and the field name is "username", I think it would be more understandable if there was a description text or if the field name was like "name" or "org_name" instead of "username". Please don't get me wrong, I'm not saying to do it like this (write documentation) it's just my opinion. That's why I opened such an issue. Thanks for your understanding and help.
KN4CK3R commentedon Sep 20, 2022
Org and user model are the same internally, so that may be reason. I would like to say "it's the same as GitHub does" but they named the field just
name
. May be changed in the future. 🤷♂️Add name field for org api (#21270)