JSON Merge
Deep merge two or more JSON objects — combine configurations, patch data, and merge API responses.
About JSON Merge
JSON deep merge combines two JSON objects by recursively merging their properties. Unlike a shallow merge (Object.assign), deep merge handles nested objects — so nested configurations are combined rather than replaced. This is essential when merging default settings with user overrides, patching API response data, or combining partial JSON objects from multiple sources.
In a deep merge, JSON B values take precedence over JSON A values when both objects have the same key. For nested objects, the merge recurses into them. For arrays, you can choose to concatenate them or have B replace A.
Common uses include merging application config overrides, combining partial API responses, patching JSON fixture files for testing, and merging Kubernetes manifest overrides with base configurations.