
Testing Code That Produces JSON From Asserts to Contracts
A tested guide to testing JSON output: asserts, snapshots, volatile fields, schemas, generated data, fixtures and property tests, with a mutation matrix.
Everything you need to level up your coding skills.

A tested guide to testing JSON output: asserts, snapshots, volatile fields, schemas, generated data, fixtures and property tests, with a mutation matrix.

Decode JSON into Go structs with struct tags: null versus missing with pointers, case-insensitive keys, int64 ids, wrong-type errors and the omitempty trap.

One order document read in Go, Java, Rust, C#, PHP, Ruby, Python, Node and Bash: unknown keys, case, nulls, big ints, depth, duplicates and strictness.

Why a PUT drops fields, why dict.update clobbers nested objects, how absent differs from null in Pydantic, and how field-level SQL avoids lost updates.

Measure schema drift in a jsonb column with key counts and type counts, see how it changes a sum, and stop it with a NOT VALID check constraint.

A tested guide to where JSON belongs in an application: columns, API shapes, settings, events, drift and patches, with measured costs in PostgreSQL.

A cron job that writes a daily CSV report from SQL: wrapper script, atomic output, a lock against overlap and the environment traps that bite at 2 a.m.

Capture every row an import refuses, with its line, column and reason, in a form a person can fix and replay. A DuckDB example with real reject tables.

A provider adds, renames or reorders columns and your load breaks or, worse, succeeds. A header check that names the change, aliases and a policy per case.

Load small reference CSVs with dbt seeds from version control, set column types so zip codes keep their zeros, and learn when seeds are the wrong tool.

Load a daily CSV in Airflow with one plain Python task instead of a chain of operators: idempotent by date, safely retried and testable outside Airflow.

Poll a folder for new CSV files and import each only once it has stopped changing. Why file events fire too early, a stable-file watcher and inotify on Linux.
We send one email when a new article is published. No spam.