Have only full name in api organization model object. #9587

Closed
opened 2025-11-02 08:43:47 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @ozgurceozturkce on GitHub (Sep 18, 2022).

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.

Ekran görüntüsü 2022-09-19 015910

Ekran görüntüsü 2022-09-19 002620

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

Originally created by @ozgurceozturkce on GitHub (Sep 18, 2022). ### 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. ![Ekran görüntüsü 2022-09-19 015910](https://user-images.githubusercontent.com/4337205/190931937-ad56f71f-a732-4bbe-a13d-025be70c24b7.png) ![Ekran görüntüsü 2022-09-19 002620](https://user-images.githubusercontent.com/4337205/190928806-a56d7670-3666-46e7-ac4e-d4ba60ca6c6a.png) 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. ```JSON { "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
GiteaMirror added the type/bug label 2025-11-02 08:43:47 -06:00
Author
Owner

@KN4CK3R commented on GitHub (Sep 18, 2022):

username should contain the value.

@KN4CK3R commented on GitHub (Sep 18, 2022): `username` should contain the value.
Author
Owner

@ozgurceozturkce commented on GitHub (Sep 18, 2022):

KN4CK3R, username is not available in organization api model. Where exactly should I put a username?

@ozgurceozturkce commented on GitHub (Sep 18, 2022): [KN4CK3R](https://github.com/KN4CK3R), username is not available in organization api model. Where exactly should I put a username?
Author
Owner

@KN4CK3R commented on GitHub (Sep 19, 2022):

It's in your screenshot. Third from bottom.

grafik

You don't call the API with the display name but the username.

grafik

@KN4CK3R commented on GitHub (Sep 19, 2022): It's in your screenshot. Third from bottom. ![grafik](https://user-images.githubusercontent.com/1666336/190958470-f4f65962-7ab4-4249-a61f-8b2903c39fc7.png) You don't call the API with the display name but the username. ![grafik](https://user-images.githubusercontent.com/1666336/190958712-5859dacd-03af-424c-b356-e61a91e1f05c.png)
Author
Owner

@ozgurceozturkce commented on GitHub (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.

@ozgurceozturkce commented on GitHub (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.
Author
Owner

@KN4CK3R commented on GitHub (Sep 19, 2022):

Which documentation are you talking about?

@KN4CK3R commented on GitHub (Sep 19, 2022): Which documentation are you talking about?
Author
Owner

@ozgurceozturkce commented on GitHub (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.

@ozgurceozturkce commented on GitHub (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.
Author
Owner

@KN4CK3R commented on GitHub (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. 🤷‍♂️

@KN4CK3R commented on GitHub (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. 🤷‍♂️
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9587