yaml

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultYAMLFormat = huma.Format{
	Marshal: func(w io.Writer, v any) error {
		return yaml.NewEncoder(w).Encode(v)
	},
	Unmarshal: yaml.Unmarshal,
}

DefaultYAMLFormat is the default YAML formatter that can be set in the API's `Config.Formats` map. This is usually not needed as importing this package automatically adds the text format to the default formats.

config := huma.Config{}
config.Formats = map[string]huma.Format{
	"application/yaml": huma.DefaultYAMLFormat,
	"yaml":             huma.DefaultYAMLFormat,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL