YAML Gotchas: Norway Problem and Boolean Traps
Avoid notorious YAML pitfalls: the Norway problem (NO parsed as false), octal number literals, multi-document files, and duplicate key behavior.
Published:
Tags: yaml, debugging, configuration
YAML Gotchas Guide: Norway Problem, Octal Literals, and Boolean Traps YAML has a well-deserved reputation for silent bugs. Unlike JSON, where a malformed document is a parse error, YAML will happily parse something that looks like one thing and produces another. These aren't YAML bugs — they're YAML 1.1 spec features that made sense in 2005 and have caused production incidents ever since. This guide covers the specific footguns you'll encounter in real YAML files, why they exist, and how to avoid them. --- The YAML Version Problem Most of the gotchas in this guide are YAML 1.1 behaviors that were changed in YAML 1.2 (published in 2009). The problem: most parsers in production still implement YAML 1.1. | Parser | Version | Notes | |--------|---------|-------| | PyYAML (Python) | 1.1 |…
All articles · theproductguy.in