Skip to content

ProjectOptions has wrong field & Project struct miss Organization related fields #2110

@DariuszPorowski

Description

@DariuszPorowski

According to official GitHub API docs for Update a project, one of the body fields is private, but current implementation in the go-github is public. projects.go#L86

Moreover, the current struct that returns the Project is incomplete. During Get a project call on the Organization Project, the response also returns two fields: organization_permission and private (related to the issue described above). Example response:
{ "owner_url": "https://api.github.com/orgs/ORG", "url": "https://api.github.com/projects/1234", "html_url": "https://github.com/orgs/ORG/projects/19", "columns_url": "https://api.github.com/projects/1234/columns", "id": 1234, "node_id": "PRO_kwDOBXDcOc4AzHJH", "name": "test", "body": "", "number": 19, "state": "open", "creator": { "login": "USER", "id": 5678, "node_id": "MDQ6VXNlcjM0MzE4MTM=", "avatar_url": "", "gravatar_id": "", "url": "https://api.github.com/users/USER", "html_url": "https://github.com/USER", "followers_url": "https://api.github.com/users/USER/followers", "following_url": "https://api.github.com/users/USER/following{/other_user}", "gists_url": "https://api.github.com/users/USER/gists{/gist_id}", "starred_url": "https://api.github.com/users/USER/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/USER/subscriptions", "organizations_url": "https://api.github.com/users/USER/orgs", "repos_url": "https://api.github.com/users/USER/repos", "events_url": "https://api.github.com/users/USER/events{/privacy}", "received_events_url": "https://api.github.com/users/USER/received_events", "type": "User", "site_admin": false }, "created_at": "2021-09-28T16:52:01Z", "updated_at": "2021-09-28T17:10:19Z", "organization_permission": "write", "private": false }
I'll try to fix it and do PR.

Metadata

Metadata

Labels

Breaking API ChangePR will require a bump to the major version num in next release. Look here to see the change(s).

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions