MCPcopy
hub / github.com/danielgtaylor/huma / MarshalJSON

Method MarshalJSON

openapi.go:1558–1571  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1556}
1557
1558func (o *OpenAPI) MarshalJSON() ([]byte, error) {
1559 return marshalJSON([]jsonFieldInfo{
1560 {"openapi", o.OpenAPI, omitNever},
1561 {"info", o.Info, omitNever},
1562 {"jsonSchemaDialect", o.JSONSchemaDialect, omitEmpty},
1563 {"servers", o.Servers, omitEmpty},
1564 {"paths", o.Paths, omitEmpty},
1565 {"webhooks", o.Webhooks, omitEmpty},
1566 {"components", o.Components, omitEmpty},
1567 {"security", o.Security, omitNil},
1568 {"tags", o.Tags, omitEmpty},
1569 {"externalDocs", o.ExternalDocs, omitEmpty},
1570 }, o.Extensions)
1571}
1572
1573// YAML returns the OpenAPI represented as YAML without needing to include a
1574// library to serialize YAML.

Callers 1

DowngradeMethod · 0.95

Calls 1

marshalJSONFunction · 0.85

Tested by

no test coverage detected