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.
[ Parent
| on HN ]
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.