Open tanmaymishu opened 1 year ago
Hi, amazing work 👍
I have the following json:
{ "people": [ {"name": "John", "addresses": [{"zip": 123}]} ] }
When I try to access the name property inside people, result.Paths() returns a slice of strings containing the path like this:
result := gjson.Get(string(json), field) fmt.Println(result.Paths(string(json)))
people.#.name [people.0.name]
people.#.name
[people.0.name]
However when I do the same for the zip inside the addresses array,
zip
addresses
people.#.addresses.#.zip
the result.Paths() no longer returns a slice of strings.
Is this a known limitation? If so, is there a workaround for this?
Looks like there is a similar issue: https://github.com/tidwall/gjson/issues/267
Hi, amazing work 👍
I have the following json:
When I try to access the name property inside people, result.Paths() returns a slice of strings containing the path like this:
people.#.name
[people.0.name]
However when I do the same for the
zip
inside theaddresses
array,people.#.addresses.#.zip
the result.Paths() no longer returns a slice of strings.
Is this a known limitation? If so, is there a workaround for this?