Route `projects/:id` should return username, state, avatar_url, web_url for group-owned projects
Description
Problem: The data returned when performing a GET on the projects/:id
endpoint is inconsistent between projects owned by users and projects owned by groups.
Partial response for user-owned project
{
"owner": {
"id": 1727177,
"name": "Jake Krammer",
"username": "jkrammer",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/7afaf37513412090d69ff243864b8bf5?s=80&d=identicon",
"web_url": "https://gitlab.com/jkrammer"
},
"namespace": {
"id": 2121764,
"name": "jkrammer",
"path": "jkrammer",
"kind": "user",
"full_path": "jkrammer",
"parent_id": null,
"plan": null
}
}
Partial response for group-owned project
{
"namespace": {
"id": 500013,
"name": "pages",
"path": "pages",
"kind": "group",
"full_path": "pages",
"parent_id": null
}
}
The owner field in the user-owned project response contains id
, name
, username
, state
, avatar_url
, and web_url
. However, the group-owned project response does not always contain an owner field, and, if it does, it refers to the creator of the project, not the group that currently owns it. Thus, if I want to display the avatar and link of a group-owned project, I have to make an additional request to the groups/:id
route using the namespace.id
from the response to grab those URLs.
Possible Solutions
- Enhance the namespace field on group-owned projects to return missing information such as
username
,state
,avatar_url
, andweb_url
. - Return a new field
group
with all of the same information as owner for group-owned projects