go-github icon indicating copy to clipboard operation
go-github copied to clipboard

IssueType is missing the is_enabled field returned by the API

Open MarcHuang168 opened this issue 2 months ago • 0 comments

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.

MarcHuang168 avatar Sep 02 '26 22:09 MarcHuang168