Visual RFC.
ALL RFCs / RFC 7396
Read the RFC ↗
RFC 7396 / JSON MERGE PATCH

Merge object members

01

An object patch visits the members it names, recursively updating nested objects while leaving unmentioned members alone.

RFC 7396 · § 2EXAMPLE
3 / 3
Merge object membersA nested color update preserves profile.name and active, changes color to green and adds newsletter true. The patch only names the intended changes.Merge the named object membersOriginal teaching example · data values, not text editsTarget{"profile":{ "name":"Ada", "color":"blue"},"active":true}Patch{"profile":{ "color":"green"},"newsletter":true}merge named membersResult{"profile":{"name":"Ada","color":"green"},"active":true,"newsletter":true}Unmentioned name and active values survive
03
Keep unmentioned members.

The result keeps Ada and active, uses green, and includes newsletter: true.

Source for this drawing: RFC 7396 · Read RFC section 2 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Terms in this drawing
Target
The JSON value to which the patch is applied.
Recursive merge
Apply the same rules again inside a named member.
Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Apply the object patch by member name, recursively.

  • When the patch is an object, process its name/value pairs. A non-null value is merged recursively with the corresponding target member; a member not already present can be added.
  • An object patch leaves unmentioned target members unchanged. Nested object patches also leave unmentioned nested members unchanged; this is not a wholesale replacement of every object encountered.
  • The operation works on JSON data values, not text edits. Whitespace, member order and numeric precision beyond the implementation’s abilities are not preserved by this specification. Results on objects with duplicate member names are undefined.
DETAILS

Example target: {"profile":{"name":"Ada","color":"blue"},"active":true}. Patch: {"profile":{"color":"green"},"newsletter":true}. The result retains profile.name and active, changes profile.color, and adds newsletter. These are fictional values, not a schema or an access policy.

Read the RFC section ↗

All chapters in RFC 7396

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗