Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared_with_groups returns different types for Groups and Projects #3579

Closed
2 tasks done
Rein142 opened this issue Apr 30, 2024 · 5 comments · Fixed by #3583 or #3589
Closed
2 tasks done

shared_with_groups returns different types for Groups and Projects #3579

Rein142 opened this issue Apr 30, 2024 · 5 comments · Fixed by #3583 or #3589
Labels
released This issue/pull request has been released. type:types Adding or enhancing typescript types

Comments

@Rein142
Copy link

Rein142 commented Apr 30, 2024

Description
I am trying to implement a function in React (typescript) that compares the properties of shared_with_groups on a Group or Project with ones that a user wants to add to said resource. But I am running into the fact that on Groups, calling on the shared_with_groups attribute, gitbeaker returns this as a ProjectSchema array, whereas on Projects it returns this as a string array. Is this an intended feature? I don't see how the following output makes sense in a ProjectSchema:

"shared_with_groups": [
  {
    "group_id": <id>,
    "group_name": "<name>",
    "group_full_path": "<path>",
    "group_access_level": <access_level>,
    "expires_at": <expiration_date>
  }
]

Can someone tell me whether this is intended or not, and if it is, why exactly?

I call upon these properties like this:

const groupInfo = await this.gitlabApi.api.Groups.show(<group_id>)
const groupSharedWithGroups = groupInfo.shared_with_groups

const projectInfo = await this.gitlabApi.api.Projects.show(<project_id>)
const projectSharedWithGroups = projectInfo.shared_with_groups

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.
@jdalrymple
Copy link
Owner

Sounds like a typo, but ill double check it and follow up

@Rein142
Copy link
Author

Rein142 commented May 7, 2024

Looking at the fix it changed the string array return type for the ProjectSchema, but within the ExpandedGroupSchema it still returns a ProjectSchema array, is this intended then?

@jdalrymple
Copy link
Owner

Looking at the fix it changed the string array return type for the ProjectSchema, but within the ExpandedGroupSchema it still returns a ProjectSchema array, is this intended then?

It isnt, just overlooked.

@jdalrymple
Copy link
Owner

🚀 Issue was released in 40.1.0 🚀

@jdalrymple jdalrymple added the released This issue/pull request has been released. label Jul 8, 2024
@jdalrymple
Copy link
Owner

🚀 Issue was released in 40.1.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released. type:types Adding or enhancing typescript types
Projects
None yet
2 participants