←back to thread

JSON Patch

(zuplo.com)
299 points DataOverload | 2 comments | | HN request time: 0.49s | source
Show context
bsimpson ◴[] No.41881312[source]
`/` is a weird choice of delimiter for JSON.

Since JSON is a subset of JS, I would have expected `.` to be the delimiter. That jives with how people think of JSON structures in code. (Python does require bracket syntax for traversing JSON, but even pandas uses dots when you generate a dataframe from JSON.)

When I see `/`, I think:

- "This spec must have been written by backend people," and

- "I wonder if there's some relative/absolute path ambiguity they're trying to solve by making all the paths URLs."

replies(9): >>41881377 #>>41881605 #>>41881615 #>>41882491 #>>41883303 #>>41883342 #>>41885101 #>>41885337 #>>41888089 #
1. PufPufPuf ◴[] No.41888089[source]
Also the escaping uses "~" as the escape character, and it escapes "~" and "/" as "~0" and "~1" instead of "~~" and "~/". This whole spec feels like it was written by aliens.
replies(1): >>41888798 #
2. krick ◴[] No.41888798[source]
That I really don't like, it doesn't make any sense. "/" as a path delimiter feels totally ok though. I mean, it's path, after all. Also, I'd expect "." to be a part of a key much more often, than "/". And also it really doesn't matter what delimiter you use.