Re:JSON Patch – a format for describing changes to a JSON do...
by kolev on Wednesday October 29, 2014 @08:34PM
(#8530759)
I think you're missing the point. If I want to patch just one node and don't care what the rest of the document is, I cannot just use a text diff.
[ Parent
| on HN ]
Re:JSON Patch – a format for describing changes to a JSON do...
by DannyBee on Wednesday October 29, 2014 @08:49PM
(#8530799)
Can you explain why?
This seems like a trivial application of any copy/add delta format, which are easily expressed in text diff format.
Re:JSON Patch – a format for describing changes to a JSON do...
by jackhammer on Wednesday October 29, 2014 @09:15PM
(#8530860)
A simple example: if the order of the keys is different, say because of a different json implementation, semantically the document is identical, but you can't apply the patch anymore.
Re:JSON Patch – a format for describing changes to a JSON do...
by DonHopkins on Wednesday October 29, 2014 @11:55PM
(#8531289)
That's why you use a canonicalizing JSON serializer, which you'd also want to use if you were tracking changes to JSON in git, for example.
Re:JSON Patch – a format for describing changes to a JSON do...
by hmbg on Thursday October 30, 2014 @02:10AM
(#8531640)
The OP was talking about the current incumbent, and the solution proposed does not work for web applications, since the JSON.stringify in most browsers do not sort keys. Sure, you could implement your own javascript version, but it will be at least a couple of orders of magnitude slower.
Re:JSON Patch – a format for describing changes to a JSON do...
by azinman2 on Thursday October 30, 2014 @12:54AM
(#8531449)
That's very limiting. So I'm suppose to use the same Json library on various platforms for client as well as server? And what have you really gained?
Re:JSON Patch – a format for describing changes to a JSON do...
by DannyBee on Thursday October 30, 2014 @06:51PM
(#8536298)
There are plenty of textual tree delta formats too.
Re:JSON Patch – a format for describing changes to a JSON do...
by verroq on Wednesday October 29, 2014 @09:57PM
(#8530960)
Because you may not want to serialise your data.
Because the order of a json dictionary key is undefined.