jsonpath
jsonpath copied to clipboard
The JSONPath standard supports single-quotes for bracket notation (see [here](https://github.com/json-path/JsonPath#operators)) but they fail with a syntax error: ```go m := map[string]interface{}{ "field": map[string]interface{}{ "sub-field": "hello", }, } value, err :=...
Hello, I have this struct with the following JSON annotations: ``` MyFancyStruct struct { SomeNestedProperty []map[string]interface{} `json:"someNestedProperty,omitempty,nocopy"` } ``` And this JSONPath: ``` $.someNestedProperty[*][*].some_other_prop ``` If I do the following:...
I am trying to apply a filter and then pick the first element from the resulting set and just trying things wildly :) JSONPath: `$.items[?(@.available && @.id>1),0].id` ``` parsing error:...
This fixes the problem where `jsonpath.Get` doesn't work if the root object is a struct instead of blank interface. I wrote the below test that shows the issues and also...
@cburgmer's JSONPath comparison project is currently discussing some [issues](https://github.com/cburgmer/json-path-comparison/issues?q=is%3Aissue+is%3Aopen+label%3A%22Proposal+A%22) relating to a proposed implementation of JSONPath known as "Proposal A". May I encourage you to get involved if you are...
When path doesn't begin with a `$` Get doesn't return an error when the field doesn't exist, Get does return an error when path begins with `$`. See example below...
Hello, I use `jsonpath` in one of my projects. It works perfectly for most of my use-cases. Nonetheless, I need to do something like this: ``` $..[? @.example ] ```...
The following queries provide results that do not match those of other implementations of JSONPath (compare https://cburgmer.github.io/json-path-comparison/): - [ ] `$.2` Input: ``` {"a": "first", "2": "second", "b": "third"} ```...
I think I should get the full paths and values when running this expression **`{#: $.a.b.c..[?(@.e == 1)]}`** on this json: ``` { "a": { "x": { "d":1 }, "b":...
`v := interface{}(nil) json.Unmarshal([]byte(`{ "welcome":{ "123456":["Good Morning", "Hello World!"] } }`), &v) welcome, err := jsonpath.Get("$.welcome.123456[1]", v)`