Verify and validate YAML syntax correctness.
Unlike JSON, which enforces strict typing by requiring quotes around all strings, YAML relies heavily on implicit typing to keep files clean and readable for humans.
A YAML parser reads an unquoted value and uses a series of regular expressions to infer its type. If it sees age: 25, it infers an Integer. If it sees name: Alice, it infers a String. While this makes writing YAML fast, it introduces severe parsing ambiguities.
In the older YAML 1.1 specification, the standard defined a massive set of boolean aliases. Along with true and false, words like yes, no, on, and off were also evaluated as booleans.
This led to the infamous "Norway Problem" in software engineering. If a developer wrote a list of ISO country codes for a configuration file:
countries: - GB - FR - NO
The parser would infer GB as a string, FR as a string, and NO as the boolean value false. This silently corrupted millions of configuration files globally.
To fix these issues, the YAML 1.2 specification (released in 2009) modernized the format to match JSON semantics.
It strictly removed the ambiguous boolean aliases (so yes and no are now just strings). However, a terrifying amount of legacy infrastructure and popular parsers (including PyYAML in Python) still default to the YAML 1.1 spec today. Because of this, security and devops engineers strongly recommend explicitly quoting any string that could be mistaken for a number or boolean in YAML.
In the infamous 'Norway Problem', how did older YAML parsers interpret the string 'NO' in a list of country codes?