Documentation
¶
Overview ¶
Package yaml converts JSON documents (the form produced by the OpenAPI emitters) to YAML. It is a minimal, hand-rolled converter that supports only the values the emitters produce: objects, arrays, strings, numbers, booleans, and null.
For round-trip verification against a real YAML parser, see the separate test module at internal/spec/yaml/roundtrip_test (kept out of the main module so gopkg.in/yaml.v3 never appears in the dependency graph).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromJSON ¶
FromJSON converts JSON bytes to YAML bytes. It supports only the subset of values that the OpenAPI emitters produce: objects, arrays, strings, numbers, booleans, and null.
The input JSON is decoded with json.Number preserved, so integers of any magnitude survive the conversion verbatim. Keys in objects are sorted alphabetically for stable output (matching the key order encoding/json produces for the JSON endpoint).
This is a deliberately minimal implementation: there is no support for anchors, custom tags, or other advanced YAML features. It is sufficient for emitting OpenAPI specs as YAML.
Types ¶
This section is empty.