How the YAML is written
Objects become indented key: value mappings (2 spaces per level), arrays become - item lists, and lists of objects place the first key on the dash line, the style used in Kubernetes manifests. Empty objects and arrays are written as {} and [].
Strings that get quoted
| JSON string | YAML output | Why |
|---|---|---|
| "yes" | "yes" | YAML 1.1 parsers read yes as true |
| "1.0" | "1.0" | Would become a number |
| "a: b" | "a: b" | Colon-space starts a mapping |
| "#tag" | "#tag" | # starts a comment |
| "" | "" | Empty value would be null |
Supported YAML subset
The YAML reader handles what most config files use: nested mappings by indentation, block lists (- item), lists of mappings, plain, single- and double-quoted scalars, numbers, true/false, null/~, comments, | and > block scalars, and JSON-style flow collections such as [1, 2].
Not supported: anchors and aliases (&, *), tags (!!str), multiple documents in one stream, complex keys and YAML 1.1 booleans like yes/on (they stay strings, as in YAML 1.2). For those files use a full YAML library.