Skip to content

use jsonpath as key #234

Description

@bartsimp

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

Activity

  1. buger commented on Aug 6, 2021

    @buger
    Owner

    What about adding helper like this?

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

    @tedyu

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

  3. added a commit that references this issue on Jul 28, 2026
    f6ddf26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions