4 ms·
I agree "." would make more sense than "/". I actually think an array would be better, ["foo","bar"] for "foo.bar". How many many bugs are introduced by people
by ks2048 2y ago
I agree "." would make more sense than "/".
I actually think an array would be better, ["foo","bar"] for "foo.bar". How many many bugs are introduced by people not escaping properly? It's more verbose, but judging by the rest of the standard, they don't seem to be emphasizing brevity.
- graftak 2y agoNot only that; both a dot (“.”) and a forward slash (“/”) are allowed to be used in/as a JSON property name. An array of keys alleviates this issue entirely because any string element of the array can be used as a JSON object property name too.
- kevincox 2y agoDefinitely agree on the array. They were smart enough to use JSON for the patch format so that people didn't have to write custom parsers but then used a selector syntax that requires a custom parser (and serializer). It seems like an obvious unforced error.
- PufPufPuf 2y agoYou would need to somehow differentiate between absolute and relative paths, though.