YAML

YAML Merge — Overlay One Configuration on Another

Merges an overlay document onto a base document and lists every value the overlay replaced.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste the base configuration on the left and the overlay on the right.
  2. Decide whether a sequence in the overlay should replace the base sequence or be added to it.
  3. Select Merge, then read the list of overridden paths in the summary before you look at the document.
  4. Check every override was intended. That list is the point of the tool.

What yaml merge does

Layered configuration is everywhere: a base file plus a per-environment overlay, a chart plus its values, a compose file plus an override. What none of those tools show you clearly is the result — you deploy and find out. This merges the two documents the way most of them do, mapping keys merged recursively, and shows you the document that comes out.

More useful still is the list of what the overlay replaced. Every value it overrode is named by its path, so a production overlay that quietly resets a replica count or a timeout you did not mean it to touch is visible before it ships rather than afterwards. Sequences replace by default, which is what most tools do, and can be concatenated instead.

Frequently asked questions

Mappings are merged recursively: a key present in both is merged again, a key only in the overlay is added, and a key only in the base is kept. When the two values are not both mappings, the overlay wins. That is what most layered configuration tools do.

By default the overlay sequence replaces the base sequence entirely, which is what most tools do and what surprises most people. Switch to joining them end to end if you want the base items kept. Either way, any replaced sequence is named in the list of overrides.

It is the reason to use this rather than deploying and finding out. Every value the overlay replaced is named, so an environment overlay that quietly resets a replica count or a timeout is visible before it ships.