Downstream issue: integrations/terraform-provider-github#2357
GitHub has a meta information API, and go-github has a corresponding implementation:
In the response of this API endpoint, the JSON unmarshal always seems to fail for the Domains field -- because the type of the value is different from what is expected.
In go-github, values under domains property is expected to be map[string][]string:
|
// A map of GitHub services and their associated domains. Note that many |
|
// of these domains are represented as wildcards (e.g. "*.github.com"). |
|
Domains map[string][]string `json:"domains,omitempty"` |
But it actually looks like this (see https://api.github.com/meta):
{
... snip ...,
"domains": {
"website": [ "*.github.com", ... snip ... ],
"codespaces": [ "*.github.com", ... snip ... ],
"copilot": [ "*.github.com", ... snip ... ],
"packages": [ "mavenregistryv2prod.blob.core.windows.net", ... snip ... ],
"actions": [ "*.actions.githubusercontent.com", ... snip ... ],
"artifact_attestations": {
"trust_domain": "",
"services": [ "*.actions.githubusercontent.com", ... snip ... ]
}
}
}
The values under artifact_attestations field clearly deviates from the []string type.
This incompatibility causes MetaService.Get() to fail with errors like Error: json: cannot unmarshal object into Go struct field APIMeta.domains of type []string.
Downstream issue: integrations/terraform-provider-github#2357
GitHub has a meta information API, and go-github has a corresponding implementation:
In the response of this API endpoint, the JSON unmarshal always seems to fail for the
Domainsfield -- because the type of the value is different from what is expected.In go-github, values under
domainsproperty is expected to bemap[string][]string:go-github/github/meta.go
Lines 73 to 75 in 882755a
But it actually looks like this (see https://api.github.com/meta):
The values under
artifact_attestationsfield clearly deviates from the[]stringtype.This incompatibility causes
MetaService.Get()to fail with errors likeError: json: cannot unmarshal object into Go struct field APIMeta.domains of type []string.