sileht / python-jsonpath-rw-ext

Extensions for JSONPath RW
Apache License 2.0
59 stars 19 forks source link

Make results of a sort indexable and traversable #7

Closed cdent closed 8 years ago

cdent commented 8 years ago

Fixes #6

The results of SortedThis.find needs to be a single item list DatumInContext with a value of the sorted data. This allows for queries against the results as shown in the added tests.

In other words this makes

$.foo.sorted[0]

and things like that, work.

cdent commented 8 years ago

If this is going to break things for where the module is used elsewhere, that's fine. I've monkey patched it in gabbi for the time being. Having the functionality is a requirement in order to be able to make json path queries against responses that contain lists of complex objects (which is trendy in json these days).

sileht commented 8 years ago

Ceilometer tests still pass with this change, I will bump the next version to 1.0.0 in case we have to put an upper-constraint in Ceilometer. If something unexpected occurs and because this is a small API change.