Json Merge Patch

A standardized way to describe a partial update to a JSON document, defined in RFC 7396 and carried as the application/merge-patch+json media type on an HTTP PATCH. The patch document mirrors the shape of the target — present members are replaced, null members are removed, and absent members are left alone — which makes it the lowest-ceremony option for partial updates when consumers should not have to send a whole resource back to change one field. Declaring merge-patch support explicitly tells consumers and agents that PATCH means RFC 7396 semantics rather than a provider-invented convention.

Also known as: Merge Patch, RFC 7396, merge-patch+json, Partial Update

Example

json-merge-patch.yaml
- type: JSONMergePatch
  url: https://developers.example.com/json-merge-patch

Standards

HTTP Headers

HeaderDirectionSpecDescription
Content-Type request RFC 7396 §4 Must be application/merge-patch+json for a merge patch request body.
Accept-Patch response RFC 5789 §3.1 Advertises which patch media types a resource accepts; the discovery hook most providers skip.
If-Match request RFC 9110 §13.1.1 Guards against lost updates by conditioning the patch on the current ETag.
ETag response RFC 9110 §8.8.3 Gives clients the validator to send back in If-Match on the next patch.

Status Codes

Media Types

OpenAPI Expression

Governance Rules

Risk & Compliance

OWASP:

Compliance:

Security: Merge patch is a mass-assignment vector by design — the patch document names the fields to change, so any writable field an attacker can guess is reachable unless the server allowlists per-property authorization. Two further traps are specific to RFC 7396: a null member means delete, so a client that serializes absent optional fields as null will silently erase data; and merge patch cannot address array elements, so array members are always replaced wholesale. Reject unknown members, authorize per property rather than per resource, and pair patches with If-Match so concurrent writers cannot clobber each other.

Tools

Suggested Metrics

Example Implementations

Related Properties

Tags


All Common Properties