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

Method DowngradeYAML

openapi.go:1697–1704  ·  view source on GitHub ↗

DowngradeYAML converts this OpenAPI 3.1 spec to OpenAPI 3.0.3, returning the YAML []byte representation of the downgraded spec.

()

Source from the content-addressed store, hash-verified

1695// DowngradeYAML converts this OpenAPI 3.1 spec to OpenAPI 3.0.3, returning the
1696// YAML []byte representation of the downgraded spec.
1697func (o *OpenAPI) DowngradeYAML() ([]byte, error) {
1698 specJSON, err := o.Downgrade()
1699 buf := bytes.NewBuffer([]byte{})
1700 if err == nil {
1701 err = yaml.Convert(buf, bytes.NewReader(specJSON))
1702 }
1703 return buf.Bytes(), err
1704}

Callers 1

NewAPIFunction · 0.80

Calls 3

DowngradeMethod · 0.95
ConvertFunction · 0.92
BytesMethod · 0.80

Tested by

no test coverage detected