Summary
- RFC 6902, April 2013, defines "a format ... for expressing a sequence of operations to apply to a target JSON document", suitable for the HTTP PATCH method.
- Its operations include
test, which "tests that a value at the target location is equal to a specified value" — the verb that makes a patch conditional instead of blind. - RFC 7386, January 2015, offers the other design: "a syntax that closely mimics the document being modified", where "null values in the merge patch are given special meaning to indicate the removal of existing values".
Why sending the whole document stopped working
PUT is a perfectly good idea until the document is a megabyte and the change is one field. Then it becomes a way to lose arguments: two editors, two full copies, one winner, and no record of who meant what.
Partial modification needs a language for change. The base protocol had none, which is why the PATCH method and a small zoo of patch formats arrived together. A method without a format is just a verb with nothing to say.
One design is a program
A JSON Patch document is an array of operations applied in order: add, remove, replace, move, copy, test. Six verbs, a path, a value. It reads like a very small program, and it is one — with all the precision and all the failure modes that implies.
Operation five can fail after four have succeeded. The specification's answer is atomicity: the whole patch applies, or none of it does. That is the right answer, and it is also why a JSON Patch processor is real software rather than a for-loop with ambition.
The test operation is the interesting one
test is the verb that earns the format. It compares a value at a path, so a client can say: apply this, but only if the field is still what I saw. That is compare-and-swap, smuggled in as a document format.
Lost updates are the classic failure of concurrent editing — two writers, one field, and a last-write-wins policy that quietly deletes somebody's afternoon. A patch language that can express the precondition lets the server reject the stale write instead of merging two opinions into one confident wrong answer.
The other design is a document
Merge patch goes the other way. The patch looks like the target: members present replace, members absent are untouched, null means delete. No verbs, no paths, no processor worth the name.
It is far easier to write by hand and far easier to read, which is exactly why it spread. It is also lossy in a way that only hurts later. A merge patch cannot set a value to null, because null already means delete. It cannot address an array element. Arrays need out-of-band rules, which is a polite way of saying the format gives up and lets you decide.
What the pair teaches
Two RFCs, twenty-one months apart, one problem, and deliberately different trade-offs. One says everything and demands a processor. The other says most things and demands nothing.
Neither is a mistake. The mistake is pretending the simpler one is complete — which is how a system ends up unable to express the deletion of a field whose value happens to be null, and finds out in production, at the worst possible moment, in front of a customer.
The lesson about describing change
A change is a data type with its own design space: precision versus ergonomics, conditional versus blind, atomic versus incremental. Most systems never choose. They inherit whichever format their framework shipped and spend the next five years discovering its edges.
A format is a small constitution: it decides in advance which later arguments are even expressible. So when you add a way to modify something, decide what the format cannot say, write that limit down where the next developer will read it, and never let the convenient form pretend to be the complete one.
Both of these formats earned their place the same way — through implementations, not announcements. That is the only test that has ever counted.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






