Re:What's the Difference: JSON diff and patch
by smarterclayton on Wednesday February 16, 2022 @04:34PM
(#30366041)
Kubernetes supports both JSON patch and merge patch, and it has been a continuous source of amazement to me (in the “that’s a bloody giant hole in the ground” sense) of how hard actually calculating, representing, and developing durable intuition about finding differences between and merging JSON-like trees (empty lists, null vs empty, representing insertion vs deletion, lists with primary keyed members, list uniqueness, field ordering, duplicate fields, number equivalence, etc).
Add in defending against pathologically malformed patches - several vulnerabilities were discovered in the golang patch libraries Kube used - and one starts to develop a twitch whenever it is mentioned…
Re:What's the Difference: JSON diff and patch
by ninja_daro_yco on Wednesday February 16, 2022 @02:29PM
(#30364586)
Actually we are using json patch/json pointer extensively to limit data sent through network or update live data on a client(its embedded world). If user is changing single parameter on a client we sent just json patch as defined in RFC(including arrays modifications). Libraries are mature and simple to use(on client, on server we are using C++ so I suppose its a in house solution), thats why it's hard for me to understand why we need another solution for the same problem. Having said that I haven't used them in Kafka world.
Re:What's the Difference: JSON diff and patch
by Bjartr on Wednesday February 16, 2022 @02:40PM
(#30364706)
For a(n anec)datapoint, I'm using JSON Patch in a production application.
Re:What's the Difference: JSON diff and patch
by erichocean on Friday February 18, 2022 @12:30AM
(#30382451)
Same, works fine.
I haven't used any of these yet, I've been waiting for one to obviously "win " and gain some support, but have definitely felt the pain.
Use case: Sending a Kafka message to add or remove a value from an array field without having to know the rest of the array