YAML Types
YAML 1.2.2 organises all data into three node kinds: scalars (leaf values), sequences (ordered lists), and mappings (key-value pairs). Every YAML document is a tree of these three node types.
3
Node Kinds
Scalar
§10.3A YAML scalar is any single value – string, integer, float, boolean, null, or timestamp. YAML infers the type from the value pattern unless an explicit !!tag overrides it. In YAML 1.2, only true and false are booleans; yes/no/on/off are plain strings.
Sequence
§10.1A YAML sequence is an ordered list of nodes equivalent to a JSON array. Block style uses a leading dash and space (- item) for each element. Flow style uses JSON array syntax [a, b, c]. Sequences can nest sequences and mappings to any depth.
Mapping
§10.2A YAML mapping is an unordered collection of key-value pairs equivalent to a JSON object. Block style uses key: value pairs separated by newlines. Flow style uses JSON object syntax {key: value}. Keys are usually strings but can be any scalar, including integers.
YAML 1.2.2 superset rule: Every valid JSON document is valid YAML. JSON objects map to YAML mappings; JSON arrays map to sequences; JSON strings, numbers, booleans, and null map to scalars. Source: yaml.org spec 1.2.2