MCPcopy Create free account
hub / github.com/DataDog/jsonapi / MarshalInclude

Function MarshalInclude

marshal.go:62–66  ·  view source on GitHub ↗

MarshalInclude includes the json:api encoding of v within Document.Included creating a compound document as defined by https://jsonapi.org/format/#document-compound-documents.

(v ...any)

Source from the content-addressed store, hash-verified

60
61// MarshalInclude includes the json:api encoding of v within Document.Included creating a compound document as defined by https://jsonapi.org/format/#document-compound-documents.
62func MarshalInclude(v ...any) MarshalOption {
63 return func(m *Marshaler) {
64 m.included = v
65 }
66}
67
68// MarshalFields supports sparse fieldsets as defined by https://jsonapi.org/format/1.0/#fetching-sparse-fieldsets.
69// The input is a url.Values and if given only the fields included in `fields[type]=a,b` are included in the response.

Callers 4

jsonapi_test.goFile · 0.85
TestMarshalRelationshipsFunction · 0.85
BenchmarkMarshalFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestMarshalRelationshipsFunction · 0.68
BenchmarkMarshalFunction · 0.68