<div dir="ltr">Hey guys,<div><br></div><div>I&#39;ve recently encountered two standard formats that standardizes the HTTP PATCH, that could be important for formats we use for Data Sync features:</div><div><br></div><div><b>json-patch</b></div><div><a href="http://tools.ietf.org/html/rfc6902">http://tools.ietf.org/html/rfc6902</a><br></div><div><br></div><div>Defines set of operations that you can do with JSON object such as: add, remove, replace, move, copy, replace, test.</div><div><br></div><div><div>   [</div><div>     { &quot;op&quot;: &quot;test&quot;, &quot;path&quot;: &quot;/a/b/c&quot;, &quot;value&quot;: &quot;foo&quot; },</div><div>     { &quot;op&quot;: &quot;remove&quot;, &quot;path&quot;: &quot;/a/b/c&quot; },</div><div>     { &quot;op&quot;: &quot;add&quot;, &quot;path&quot;: &quot;/a/b/c&quot;, &quot;value&quot;: [ &quot;foo&quot;, &quot;bar&quot; ] },</div><div>     { &quot;op&quot;: &quot;replace&quot;, &quot;path&quot;: &quot;/a/b/c&quot;, &quot;value&quot;: 42 },</div><div>     { &quot;op&quot;: &quot;move&quot;, &quot;from&quot;: &quot;/a/b/c&quot;, &quot;path&quot;: &quot;/a/b/d&quot; },</div><div>     { &quot;op&quot;: &quot;copy&quot;, &quot;from&quot;: &quot;/a/b/d&quot;, &quot;path&quot;: &quot;/a/b/e&quot; }</div><div>   ]</div></div><div><br></div><div>The structure of the patch is list of operations, not the document itself.</div><div><br></div><div>We could actually rewrite DiffSync Server to use it (since it is very close to that format).</div><div><br></div><div><br></div><div><br></div><div><b>json-merge-patch</b> (draft)</div><div><a href="http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-0">http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-0</a></div><div><br></div><div>Defines a format where you send updated parts of the JSON Object itself in same structure as original object:</div><div><br></div><div>e.g.: object:</div><div><br></div><div><div>     {</div><div>       &quot;a&quot;: &quot;b&quot;,</div><div>       &quot;c&quot;: {</div><div>         &quot;d&quot;: &quot;e&quot;,</div><div>         &quot;f&quot;: &quot;g&quot;</div><div>       }</div><div>     }</div></div><div><br></div><div>patch:</div><div><br></div><div><div>     {</div><div>       &quot;a&quot;:&quot;z&quot;,</div><div>       &quot;c&quot;: {</div><div>         &quot;f&quot;: null</div><div>       }</div><div>     }</div></div><div><br></div><div><br></div><div><br></div><div>Cheers,</div><div><br></div><div>~ Lukas</div></div>