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.
The
issue-typeschema in GitHub's OpenAPI description includes anis_enabledboolean ("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).IssueTypeingithub/issues.godoes not have this field, so the value is silently dropped when decoding:The request type
CreateOrUpdateIssueTypesOptionsalready hasIsEnabled, but the response type does not.I'd like to add
IsEnabled *booltoIssueTypeand cover it in the existing issue type tests. PR to follow.