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

Method MarshalJSON

go/types.go:1850–1860  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

1848// crosses the RPC boundary; the runtime only learns that a token provider exists
1849// and forwards the provider name back when it needs a token.
1850func (p NamedProviderConfig) MarshalJSON() ([]byte, error) {
1851 type wire NamedProviderConfig
1852 aux := struct {
1853 wire
1854 HasBearerTokenProvider *bool `json:"hasBearerTokenProvider,omitempty"`
1855 }{wire: wire(p)}
1856 if p.BearerTokenProvider != nil {
1857 aux.HasBearerTokenProvider = Bool(true)
1858 }
1859 return json.Marshal(aux)
1860}
1861
1862// ProviderModelConfig is a BYOK model definition that references a
1863// NamedProviderConfig by name and is added to the session's selectable model

Callers

nothing calls this directly

Calls 3

wireTypeAlias · 0.85
BoolFunction · 0.85
MarshalMethod · 0.80

Tested by

no test coverage detected