3 ms·
"/biscuits/-" addresses "this value" because biscuits is not an array. If you check out the implementations at the bottom of the post, you'll see that, at runt
by hombre_fatal 5y ago
"/biscuits/-" addresses "this value" because biscuits is not an array.
If you check out the implementations at the bottom of the post, you'll see that, at runtime, if biscuits is an object they index into `obj["-"]`. And if it's an array, they special-case "-" and index into `array[length]`.
- chii 5y agoso the spec has implementation specific behavior that's not fully specified by just the spec? i rather see they implement jsonpath - https://tools.ietf.org/id/draft-goessner-dispatch-jsonpath-00.html https://tools.ietf.org/id/draft-goessner-dispatch-jsonpath-0... instead of inventing their own xpath-like expression language tbh. Edit: i suppose i shouldn't be surprised there's multiple standards to varying degrees of acceptance: https://datatracker.ietf.org/doc/html/rfc6901 https://datatracker.ietf.org/doc/html/rfc6901 so may be it is fine to use this expression language...
- chrisoverzero 5y ago> so the spec has implementation specific behavior […] No, that’s specified in the JSON Pointer spec, which this spec depends on: https://datatracker.ietf.org/doc/html/rfc6901 https://datatracker.ietf.org/doc/html/rfc6901 > […] that's not fully specified by just the spec? Specs depend on previous specs nearly all the time. Thank goodness for hyperlinks.
- hombre_fatal 5y agoI didn't mean to say that all there was were reference impls. I just clicked through the impls to quickly answer your question out of curiosity instead of scanning an RFC. It also shows this in the Pointer spec.