RealComposer
Data & Payload Slimming

JSON Merge Patch

Direct Definition

JSON Merge Patch (RFC 7396) updates a JSON document by merging a partial object into the existing resource. Present keys overwrite or recurse into nested objects, and null values remove keys. It is simpler than JSON Patch for many REST PATCH endpoints that only need shallow or nested field updates.

Technical Architecture & Deep-Dive

Merge Patch bodies look like ordinary JSON: { "name": "Updated", "settings": { "theme": "dark" } }. Servers merge settings deeply while replacing scalars at the top level. Sending null for a key deletes it, which is a common contract for optional metadata fields.

Because merge semantics can be ambiguous for arrays, APIs often document array replacement rules clearly. Edge gateways can accept Merge Patch from clients and translate to provider-specific PUT or PATCH formats, or apply merge results locally on cached read models.

Key Architectural Benefits

Human-readable PATCH bodies without op arrays.
Familiar JSON shape for client developers.
null reliably signals delete in many implementations.
REALCOMPOSER EDGE WORKSPACE

Implement JSON Merge Patch at the Edge

Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.

START BUILDING FREE

Frequently Asked Questions

Q:When should I prefer JSON Patch over Merge Patch?

Choose JSON Patch when you need ordered ops, array inserts, move/copy, or test for version checks. Merge Patch fits simple field updates.

Related Architecture Concepts

Ready-to-Use Edge Recipes