Checklist
Test what each empty-looking update will actually do
Omitting a field, removing it and storing an empty value are different instructions. Check the exact interface before a harmless-looking blank becomes a bulk change.
Before you use it
- Use when
- A mass update may clear existing values when the intended action was to leave them alone.
Keep this limit in mind
- Do not standardize all missing representations into one value before checking their semantics. Different fields in the same interface can behave differently.
Current editorial reading
Keep the rule at the right level
For an object-member update in JSON Merge Patch, an omitted member is left alone, null removes the member, and an empty string sets an empty string. This is not a rule for every JSON value: a patch that is not an object replaces its target completely. A top-level null patch therefore replaces the document with null.
Inspect the stored result
In an isolated test record with a nonempty reference field, try omission, null, empty string and an explicit replacement separately. Record both the stored value and whether the field still exists. Test arrays separately if present; Merge Patch replaces them rather than editing selected elements. Check any downstream interpretation before applying the mapping to a real batch.
Take it with you
Use the documented field and document rules, then verify the result. If the system needs a stored null to mean something distinct from removal, do not assume an object-member Merge Patch can express that change.
Sources and evidence (1)
What we checked
JSON Merge Patch distinguishes omitted object members, null-valued members and non-object patches.
The member-removal rule is scoped to object processing; the independent reference-field tests are an editorial application.
RFC 7396: JSON Merge Patch · Section 2: MergePatch pseudocode and following paragraph; Appendix A
Merge Patch does not support partial array edits and is not suitable for every JSON structure, particularly when explicit null object-member values matter.
Do not transfer these semantics to ordinary JSON storage, JSON Patch, spreadsheets or other import interfaces. Test the actual accepted media type and contract.
RFC 7396: JSON Merge Patch · Section 1, final paragraph; Section 2; Appendix A, whole-target null example
Editorial sources (1)
- RFC 7396: JSON Merge Patch — Paul Hoffman, James M. Snell
Save and practise this idea
My learning
Read. Recall. Repeat.
Save this idea and return to it on any device.
Keep exploring
Connected ideas
You are readingTest what each empty-looking update will actually do
Original edition evidence and sources
These records belong to the original released edition. The current editorial reading has its own evidence above; neither set silently replaces the other.
JSON Merge Patch distinguishes an omitted member from a member set to null: null requests removal of that member.
This is one interface contract, not a universal interpretation of empty spreadsheet cells or null values.
RFC 7396: JSON Merge Patch · Sections 1 and 2
All sources (1)
Original edition, downloads and provenance
The reading above is editorial version 0.1.0, bound to this exact source edition. The original data and saved downloads retain that edition and the separate editorial layer. They may contain earlier wording; use the current reading above when interpreting it.
Version 0.1.0
No review details are supplied for this edition.
Read the original edition and overlay as JSON · Release details