Make assumptions explicit.
Declare object fields, required keys, primitive types, nested arrays, enum values and whether unknown fields are accepted.
CASE STUDY / INTEGRATION RELIABILITY
A small contract-testing CLI for the seams between APIs, webhooks and automation steps. Define the payload you rely on, save representative fixtures, and fail CI before a breaking change reaches the workflow.
THE PROBLEM
A webhook can keep returning valid JSON while silently changing a field type, dropping a required key, adding an unsupported event, or introducing structure the next automation step cannot accept. When those assumptions exist only in a workflow editor or a developer's memory, regressions arrive in production.
Keep the contract format intentionally smaller than full JSON Schema. The tool should be understandable in one review, produce no payload-value leaks by default, and return stable exit codes for CI and automation.
Declare object fields, required keys, primitive types, nested arrays, enum values and whether unknown fields are accepted.
Validate one saved request/response or a directory of fixtures from staging, webhook samples or API adapters.
Valid fixtures exit 0, contract violations exit 1, and malformed contract/input configuration exits 2.
A missing nested property is reported with its JSON path instead of a generic validation error.
Python's type quirks are handled explicitly so true cannot accidentally satisfy an integer contract.
Allowed event names or states can be bounded without exposing the rejected value in diagnostics.
Each object boundary can allow new fields or reject them, depending on how fragile the downstream consumer is.
Nested list violations identify paths such as $.payload.tags[1] for fast triage.
Default diagnostics contain paths, violation codes and rule messages. Fixture values are not echoed into CI logs.
The same check can emit JSON for a larger monitoring system or run across every *.json fixture in a directory. The public repository includes passing and deliberately failing fixtures plus a GitHub Actions matrix.
Infers what real JSON/JSONL data looks like and compares observed shape or presence drift between datasets.
Starts from a deliberate contract and asks whether saved API/webhook fixtures still satisfy that boundary.
Observed production/staging data can inform a contract; the explicit contract can then become a lightweight release gate.
I can turn the assumptions at an API, webhook or automation boundary into a small, reviewable validation gate and regression fixture set.