
A Cheat Sheet of YAML Syntax for Everyday Config Files
One page of YAML syntax: scalars, quoting, collections, block strings, anchors, documents, comments and the values that change type. Copy-ready snippets.
Clients, formatters, linters and CLIs worth installing. Small tools that save hours.

One page of YAML syntax: scalars, quoting, collections, block strings, anchors, documents, comments and the values that change type. Copy-ready snippets.

The same 33 scalar values loaded by a 1.1 parser and a 1.2 parser: booleans, octal, base 60 and floats. Which libraries implement which, and how to stay safe.

Sort XML records by a key with XSLT or lxml so two exports of the same data produce the same file, including numeric keys and nested children.

Two branches each add a dependency to the same pom.xml and Git reports a conflict. See why, then use the union merge driver and a manual rule that works.

A feed renamed price to cost and the loader kept running with empty columns. A short script compares element path snapshots and reports the change.

A one-line XML file turns every change into one giant diff. Two ways to fix it, a textconv diff driver and a formatted file in the repo, with real output.

Make a line diff of two XML files show real changes only, by canonicalizing both sides, then use xmldiff when you need structural edit actions.

Three XML files with the same meaning gave three different checksums. Canonical XML (C14N) fixes attribute order and quoting, but not whitespace.

Load JSON fixtures into PostgreSQL for tests with jsonb_populate_recordset: 25,000 rows in 0.21 s, bad fixtures caught by constraints, one typo missed.

Test a JSON API against its OpenAPI contract with Schemathesis: 1,903 generated requests found a 500 and undocumented statuses, and missed one bug.

Six ways to write null in YAML, how they differ from the empty string, and what a key with no value, an empty list and an absent key mean to your code.

YAML allows comments with a hash, but most parsers throw them away when they load and save. What survives a round trip in PyYAML, ruamel.yaml and yq.
We send one email when a new article is published. No spam.