flashman
← All posts

YAML to JSON config drift: catch deploy bugs in review

Catch YAML and JSON config drift by comparing rendered output, booleans, arrays, comments, and environment overrides before a deploy changes behavior.

2026-06-24 · 6 min read · Rahul Chitturi

  • yaml
  • json
  • configuration

Config drift hides in the gap between the file humans review and the JSON object software actually consumes. YAML anchors, booleans, comments, and environment overrides can make a change look harmless while the rendered runtime config changes meaning.

Treat config as data. Render the exact output, format it, and compare it with the previous version before assuming the diff in source control tells the full story.

Render before you reason

YAML is readable because it has indentation, comments, and shorthand. The application usually receives a parsed object. If a deployment pipeline converts YAML to JSON, check the rendered JSON in review so the team sees the same structure the runtime will see.

  • Expand anchors and aliases before comparing behavior
  • Confirm arrays did not become comma-separated strings
  • Check null, false, and empty string as separate values
  • Verify environment-specific overlays after the base file

Watch boolean and number traps

Configuration systems differ on how they parse unquoted values. A port might become a number in one tool and a string in another. Feature flags need true booleans, not the string false. Quote intentionally, then verify the rendered JSON type.

Compare intent with output

A clean source diff can still produce a risky runtime diff when defaults move, generated fields reorder, or comments disappear. Keep a small known-good rendered fixture for important services and compare it against the new output during review.

  • Format both JSON outputs before diffing
  • Ignore ordering only when the application also ignores ordering
  • Call out deleted keys, not just changed values
  • Document why an override belongs to one environment only

A Flashman workflow

Convert YAML to JSON, pretty-print the rendered output, then diff it against the last deployed fixture. For incident response, paste redacted configs from staging and production side by side to find the exact key that drifted.

Because the tools run locally in your browser, they are useful for internal service config after secrets are removed. Do not paste live credentials, tokens, or private endpoints into shared bug reports.

Try these tools