Closed baihanliang closed 9 years ago
I assume you'd expect a jsonpointer.JsonPointerException
to be raised, right?
I was expecting to index "start" or "end" attribute via "-" array index, specifically the following call:
resolve_pointer(ranges, '/items/-/start')
Can it return something like the following based on the above input array? [7, 23, 37, 107, 179, 513, 1494, 1718, 2000, 2427, 2598, 2727, 3389, 5060, 5631, 5900, 6000]
We could index "start" or "end" attribute selectively using a fixed array index as following:
resolve_pointer(ranges.ranges, '/items/0/start') 7 resolve_pointer(ranges.ranges, '/items/1/start') 23
From RFC 6901
* exactly the single character "-", making the new referenced
value the (nonexistent) member after the last array element.
So when resolving -
the result does (by definition) not exist, and therefore cannot be resolved any further.
Thanks for the clarification regarding "-".
I am trying to index a list of dict object via resolve_pointer() and came across the following error. This happens with both version 1.1 and 1.7. The output is as below:
bliang@latite:~/lumberjack/python-json-pointer$ python Python 2.6.6 (r266:84292, Jun 18 2012, 09:57:52) [GCC 4.4.6 20110731 (Red Hat 4.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information.