jsonpath
jsonpath copied to clipboard
golang jsonpath library. follow the majority rules in this article http://goessner.net/articles/JsonPath/
The following queries provide results that do not match those of other implementations of JSONPath (compare https://cburgmer.github.io/json-path-comparison/): - [ ] `$[1:10]` Input: ``` ["first", "second", "third"] ``` Expected output: ```...
IMO, when the field is missing in the slice, instead of erring out, ignoring that and continuing onto the next index/element is more relevant I feel.
This PR fixes an issue(#20) when root object is an array and filtering via child map field values is applied and nothing is returned. Tests are also included.
… can lookup value
With this PR the jsonpath parser can aggregate structs just like maps. `json` tag of struct fields are also respected.
This PR fixes problem when root is referenced($) in a filter expression and the evaluated value was the current object(@) instead of the root. After this fix the example referenced...
Input JSON: { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of...
hey, seems like root array with filter exp doesn't work here's an example: ```golang arr := []map[string]interface{}{ { "id": 1, "foo": map[string]interface{}{ "bar": "baz", }, }, } obj := map[string][]map[string]interface{}{...
https://github.com/oliveagle/jsonpath/blob/2e52cf6e685269ed8aefec6390f3cac3ef74e730/jsonpath_test.go#L1182 Got errors when building a package with jsonpath lib: /github.com/oliveagle/jsonpath/jsonpath_test.go:1182: Fatal call has possible formatting directive %v /github.com/oliveagle/jsonpath/jsonpath_test.go:1185: Fatal call has possible formatting directive %v /github.com/oliveagle/jsonpath/jsonpath_test.go:1188: Fatal call has...
Sometimes we need to filter the children's and grandchildren's properties, a jsonpath lib should operate the .. operations.