←back to thread

JSON Patch

(zuplo.com)
299 points DataOverload | 3 comments | | HN request time: 0s | source
1. zarzavat ◴[] No.41881657[source]
Why is the path a string and not an array? That means you have to have some way to escape / in keys, and also you need to parse the path string. Parser in parser syndrome. Or otherwise it can't handle arbitrary JSON documents.
replies(2): >>41881801 #>>41882889 #
2. 10000truths ◴[] No.41881801[source]
JSON pointer escapes slashes by encoding them as "~1", and tildes are escaped by encoding them as "~0". But I agree that using an array would have made much more sense. It would also have allowed the use of integers to disambiguate array indices from object keys that happen to be numbers, without having to parse the document to be patched.
3. lilyball ◴[] No.41882889[source]
Probably because JSON Patch was "influenced by" XML Patch.