Skip to content

IssueType is missing the is_enabled field returned by the API #4503

Description

@MarcHuang168

The issue-type schema in GitHub's OpenAPI description includes an is_enabled boolean ("The enabled state of the issue type"). It is returned by the issue type endpoints, e.g. GET /orgs/{org}/issue-types (https://docs.github.com/rest/orgs/issue-types#list-issue-types-for-an-organization).

IssueType in github/issues.go does not have this field, so the value is silently dropped when decoding:

in := `{"id":410,"name":"Task","is_enabled":true}`
var it IssueType
json.Unmarshal([]byte(in), &it)
out, _ := json.Marshal(it)
// out == {"id":410,"name":"Task"}   <- is_enabled is gone

The request type CreateOrUpdateIssueTypesOptions already has IsEnabled, but the response type does not.

I'd like to add IsEnabled *bool to IssueType and cover it in the existing issue type tests. PR to follow.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions