buger/jsonparser

use jsonpath as key

bartsimp opened this issue · 2 comments

Hello,

it's possible to use a jsonpath notation to perform the lookup?

jsonparser.Get(data, "$.person.name.fullName")

equivalent to:

jsonparser.Get(data, "person", "name", "fullName")

regards

buger commented

What about adding helper like this?

func JSONPath(path) {
  return strings.Split(strings.TrimPrefix(path, "$."), ".")
}
....
jsonparser.Get(data, JSONPath("$.person.name.fullName")...)
tedyu commented

Is there recent development to support jsonpath ?
I wonder if I can use @.length to access array length.