News for hackers. Stuff that matters.
Re:JSON Patch – a format for describing changes to a JSON do... by azinman2 on Wednesday October 29, 2014 @08:32PM (#8530753)
This is about sending a diff over the network without having to either have the full json document on hand, or worrying about other concurrent changes that might wreck the diff-match-patch. It's also json-aware versus operating on pure text which might lead to invalid json documents.
Re:JSON Patch – a format for describing changes to a JSON do... by DannyBee on Wednesday October 29, 2014 @08:48PM (#8530796)
1. Errr, to apply any delta, including these, you need the document on hand. If your goal is to store deltas, this is no better than anything else.

2. This is in no way better at handling concurrent changes than anything other diff format. In fact, the extra operations it has do nothing to help you here (it is as good and bad as copy/add, or insert/delete diffs). I'd love to know why you seem to think otherwise.

JSON awareness only helps when trying to apply partial patches. At that point, the only thing it can possibly buy you is syntactic correctness, which is worthless without semantic correctness (and in fact, sometimes worse)

Re:JSON Patch – a format for describing changes to a JSON do... by function_seven on Wednesday October 29, 2014 @10:25PM (#8531037)
> Errr, to apply any delta, including these, you need the document on hand. If your goal is to store deltas, this is no better than anything else.

Doesn't this allow the sender to send updates without knowledge of the existing values, though? With a string diff, the existing value would have to be known.

> This is in no way better at handling concurrent changes than anything other diff format. In fact, the extra operations it has do nothing to help you here (it is as good and bad as copy/add, or insert/delete diffs). I'd love to know why you seem to think otherwise.

If you're sending a regular diff, you would clobber changes to other parts of the object if they were updated between your initial retrieval and subsequent change. But yeah, it doesn't seem to help with applying concurrent changes to the same part of an object, though I don't know if the patch format should shoulder that responsibility.

Re:JSON Patch – a format for describing changes to a JSON do... by nacs on Thursday October 30, 2014 @12:29AM (#8531377)
> Doesn't this allow the sender to send updates without knowledge of the existing values, though?

This system requires knowledge of existing values/nodes to create the diff/patch document.

However for JSON data, it does have the advantage of not clobbering data unlike a string diff as you mentioned.

Re:JSON Patch – a format for describing changes to a JSON do... by azinman2 on Thursday October 30, 2014 @12:49AM (#8531437)
You can know keys/paths but nothing else. Or you might have user-specific parts that won't be concurrently modified, but the base JSON doc might be modified by others. You'd have to have the latest version to do a text-based patch.

A text-based diff doesn't really gain much for what it loses in use cases.

Re:JSON Patch – a format for describing changes to a JSON do... by function_seven on Thursday October 30, 2014 @12:11PM (#8533812)
I don't see why you need to know values. The operations don't require the sender to supply them.