← Back to News
YAML

YAML 1.2.2 Published

YAML 1.2.2 Published

What Is YAML 1.2.2?

YAML 1.2.2 is a maintenance revision of the YAML 1.2 specification, published in October 2021. It does not change the YAML language — no new syntax, no removed features, no behavioural changes for well-formed input. Instead, it fixes ambiguous or incorrect phrasing in the 2009 YAML 1.2 document that had caused divergent parser implementations.

The revision is analogous to a patch release in software versioning: the version number bumps to signal that something changed, but existing code targeting YAML 1.2 continues to work unchanged. Parsers claiming conformance to YAML 1.2.2 are expected to produce the same output as YAML 1.2 parsers for any valid input.

Errata and Clarifications

The 2009 YAML 1.2 document contained a number of passages where the normative text was unclear or contradicted the production grammar. YAML 1.2.2 addresses these systematically. Key areas of clarification include:

  • Flow scalar parsing: The rules governing when a value in flow context (inside { } or [ ]) is interpreted as a plain scalar vs. a special character were underspecified. YAML 1.2.2 aligns the prose with the production rules.
  • Anchor scope: The lifetime and reachability of anchors within a multi-document stream was ambiguous. YAML 1.2.2 clarifies that anchors are scoped to a single document.
  • Implicit typing: The interaction between the Core Schema's implicit type resolution and explicit !!type tags is now described more precisely.

Parser Behaviour Before and After

For most practical YAML documents — configuration files, CI definitions, Kubernetes manifests — the difference between YAML 1.2 and 1.2.2 is invisible. Both produce the same result for well-formed, unambiguous input.

The changes matter at the edges: a parser that was previously interpreting an ambiguous production rule differently from another parser may align its behaviour with YAML 1.2.2 in a future release. This alignment improves cross-parser portability for complex documents that use anchors, flow scalars, or explicit typing.

What This Means for Users

If your YAML library announces a YAML 1.2.2 compliance update, you do not need to change your YAML documents. The update affects parser internals, not the format.

If you maintain a YAML parser, YAML 1.2.2 is now the target to implement rather than the original 1.2 document. The GitHub repository at yaml/yaml-spec is the canonical source, and the yaml-test-suite provides conformance tests to validate your implementation.

Sources

Related on fixjson.org