YAML Parsing Simulator
Edit YAML and watch what the parser actually decides your values are. The Norway problem where NO becomes the boolean false, version 1.10 becoming a lower number than 1.9, leading zeros meaning octal in one spec and decimal in another, empty against null against an empty string, block scalars, and tabs. Every document is read twice, under YAML 1.1 and YAML 1.2, so you can see exactly where the two specs disagree. The parser is real and runs in your browser.
Category: DevOps
What You Will Learn
- Why `country: NO` becomes the boolean false, and which parsers do it
- Why `version: 1.10` is a lower number than `version: 1.9`
- How YAML 1.1 and YAML 1.2 disagree about the same file, and why that matters
- The difference between an empty value, `~`, `null` and an empty string
- When a leading zero means octal and when it means decimal
- What `|` and `>` do to the newlines in a CI script
- Why a repeated key silently overwrites the one above it
- How anchors, aliases and merge keys work in a CI config
- Why a tab in indentation is rejected and so hard to spot
- Why quoting is the fix for nearly all of it
Topics covered: yaml, configuration, kubernetes, ci-cd, parsing, debugging, educational, interactive
// simulator
YAML Parsing Simulator
Edit YAML and watch what the parser actually decides your values are. The Norway problem where NO becomes the boolean false, version 1.10 becoming a lower number than 1.9, leading zeros meaning octal in one spec and decimal in another, empty against null against an empty string, block scalars, and tabs. Every document is read twice, under YAML 1.1 and YAML 1.2, so you can see exactly where the two specs disagree. The parser is real and runs in your browser.
A country list, written the obvious way. Edit it and watch what changes.
countries:
-
name: "Norway"
code: "NO"
-
name: "Sweden"
code: "SE"countries:
-
name: "Norway"
code: false
-
name: "Sweden"
code: "SE"| where | you wrote | YAML 1.1 | YAML 1.2 |
|---|---|---|---|
| countries[0].code | NO | bool false | string |
About this YAML parsing simulator
What you'll learn
- That YAML resolves your untagged values into types, and which ones surprise people
- That YAML 1.1 and YAML 1.2 disagree, so the same file means different things in different tools
- Why the failures are quiet: nothing errors, a value just stops being what you meant
- The two-character fix, and when you actually need it
How it works
- The parser is real and runs in your browser. Nothing here is a canned answer.
- Every document is read twice, once under each spec, and the differences are listed.
- Edit any example. Your own YAML is resolved by the same rules.
The behaviour shown here follows the YAML 1.2.2 specification and the older YAML 1.1 boolean type, which is the one that turns Norway into false. Most tools still ship a 1.1-era resolver: that is not a bug in your file, it is a disagreement between versions of the format.
Related: the Kubernetes terminal simulator for the manifests this bites hardest, and the Git concepts simulator for the other thing everyone learns by breaking it.
Try next
// simulator
Preview Environment Simulator
See how a pull request becomes a temporary copy of your app, complete with a private URL, safe test data, review checks, and automatic cleanup.
// game
Heroku-Style Name Generator
Generate names the way Heroku, Docker, Kubernetes, and petname do, see how the word lists combine, and learn when the birthday problem makes random names collide.
// simulator
How Docker Works Under the Hood
Watch what really happens when you run docker run -p 8080:80 nginx, one layer at a time. Step down the whole stack: the CLI, the daemon, the registry pull, containerd, the OCI runtime bundle, runc, the running container, and the shared Linux kernel. Every stage shows the real low-level command you can run yourself, so it doubles as a tour of the primitives that make a container: namespaces, cgroups, and runc. A container is not a small VM, and this shows you why.