MCPcopy Index your code
hub / github.com/github/copilot-sdk / MarshalJSON

Method MarshalJSON

go/types.go:1765–1775  ·  view source on GitHub ↗

MarshalJSON serializes the provider config, deriving the wire-only `hasBearerTokenProvider` flag from the presence of [ProviderConfig.BearerTokenProvider]. The non-serializable callback never crosses the RPC boundary; the runtime only learns that a token provider exists and forwards the provider nam

()

Source from the content-addressed store, hash-verified

1763// learns that a token provider exists and forwards the provider name back when it
1764// needs a token.
1765func (p ProviderConfig) MarshalJSON() ([]byte, error) {
1766 type wire ProviderConfig
1767 aux := struct {
1768 wire
1769 HasBearerTokenProvider *bool `json:"hasBearerTokenProvider,omitempty"`
1770 }{wire: wire(p)}
1771 if p.BearerTokenProvider != nil {
1772 aux.HasBearerTokenProvider = Bool(true)
1773 }
1774 return json.Marshal(aux)
1775}
1776
1777// CapiSessionOptions configures provider-scoped Copilot API (CAPI) session behavior.
1778//

Callers

nothing calls this directly

Calls 3

wireTypeAlias · 0.85
BoolFunction · 0.85
MarshalMethod · 0.80

Tested by

no test coverage detected