Skip to content

RFC 7386 (JSON Merge Patch)

shagaba edited this page Oct 16, 2016 · 3 revisions

Jacksync Operation Inspired by both RFC 6902 (JSON Patch) and RFC 7386 (JSON Merge Patch) :

Merge

The "merge" operation merge a JSON merge patch document value at the target location value. The "merge" operation is unique to Jacksync project inspired by both RFC 6902 (JSON Patch) and RFC 7386 (JSON Merge Patch). The operation object MUST contain a "value" member which is a JSON merge patch document. The target location MUST exist for the operation to be successful. A JSON merge patch document describes changes to be made to a target JSON document using a syntax that closely mimics the document being modified.

  • Recipients of a merge patch document determine the exact set of changes being requested by comparing the content of the provided patch against the current content of the target document.
  • If the provided merge patch contains members that do not appear within the target, those members are added.
  • If the target does contain the member, the value is replaced.
  • Null values in the merge patch are given special meaning to indicate the removal of existing values in the target.
{
	"op" : "merge", 
	"path" : "/", 
	"value" : { 
		"title" : "Jacksync unique operation",
		"version" : 6,
		"author" : { 
			"firstName" : "James" , 
			"lastName" : "Bond",
			"email" : null
		} 
	}
}