That's a Lot of YAML: The Hidden Dangers of a DevOps Staple

A satirical yet practical look at why YAML, despite its ubiquity in Kubernetes and CI/CD, is riddled with pitfalls. From Norway being parsed as a boolean to version numbers silently changing, this piece highlights the spec's quirks and offers a warning to developers. It's a must-read for anyone who's ever been burned by a YAML file.
Anyone who uses YAML long enough will eventually get burned when attempting to abbreviate Norway.
- fodkodrasz
There is no problem with YAML, just like there was no problem with XML at all. The problem is with the software devs who use it for the wrong thing. I just wonder why JSON doesn't get all the hate, while it is a terrible format also: it is not streamable (YAML is), it doesn't have comments... and non-standard workarounds are used for these features. Norway better than YAML, in my opinion.
- fypanto
chuckle
Well most of that is due to 1.1 which has been deprecated god knows for how long.
1.2 does not have the 'Norway' problem any more.
Tooting my own horn, this is how a modern YAML library looks like nowadays:
- vova_hn2
I'm still sad that JSON5 never became industry standard.
Unlike hjson, toml and many others, JSON5 didn't try to reinvent the wheel and create a totally new syntax.
Instead, they took 2 already well established standards (JSON and ECMAScript 5.1) and put them together.
I think that it is pleasant enough to write by hand while not creating yet another new syntax that you have to get used to.
- NoboruWataya
Surprised TOML didn't get mentioned in the alternatives section, it's probably my favourite configuration format.
I'm working on a project now that uses YAML for configuration (it makes more sense in this context than TOML) and am parsing it using Rust's `serde` crate (via `serde_norway`). It's not so bad if you use `#[serde(deny_unknown_fields)]` everywhere.
- masfoobar
My usage of YAML has been limited. For the times I have used it (kubenetes, docker compose, other things, etc) -- I don't get what it so special about it.
It just seems reinventing the wheel again and again.
I am not suggesting JSON is perfect, either. However I do prefer it to YAML (and XML) by a mile.
It's a shame s-expressions never taken off.
(select (id name)
(:from users)
(:where (= name "Peter")))
Or
(orders
(order
(id 1)
(code "aa1")
(qty 32)))
I know - its a sample, but you get it. :-)