Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show path result mode #54

Open
V0ldek opened this issue Nov 25, 2022 · 0 comments
Open

Show path result mode #54

V0ldek opened this issue Nov 25, 2022 · 0 comments
Labels
acceptance: go ahead Reviewed, implementation can start area: result Improvements in query result reporting help wanted External contributions welcome type: feature New feature or request
Milestone

Comments

@V0ldek
Copy link
Member

V0ldek commented Nov 25, 2022

Is your feature request related to a problem? Please describe.
When we get a match of a query we know the exact path in the JSON at which it occurs – quite naturally, JSONPath is all about that.

There should exist a result mode that includes this information in the output.

Describe the solution you'd like
Consider the query $.a..b[*], and the JSON:

{
    "a": {
        "c": [
            { "b": [1, 2, 3] },
            { "d": { "b": { "x": true } } }
        ]
    }
}

Then in the output we should find all the following paths, separated with newlines:

$['a']['c'][0]['b'][0]
$['a']['c'][0]['b'][1]
$['a']['c'][0]['b'][2]
$['a']['c'][1]['d']['b']['x']

Additional context
Note that this request can be combined with other result modes, except for count. For example, it's easy to output both byte indices and full paths. The CLI should reflect that and allow combining paths with other result modes, where it makes sense.

@V0ldek V0ldek added type: feature New feature or request help wanted External contributions welcome acceptance: go ahead Reviewed, implementation can start mod: engine area: result Improvements in query result reporting labels Nov 25, 2022
@V0ldek V0ldek added this to the v1.0.0 milestone Nov 25, 2022
@V0ldek V0ldek self-assigned this Nov 25, 2022
@github-actions github-actions bot added the acceptance: triage Waiting for owner's input label Nov 25, 2022
@V0ldek V0ldek removed their assignment Nov 25, 2022
@V0ldek V0ldek removed the acceptance: triage Waiting for owner's input label Nov 25, 2022
@V0ldek V0ldek modified the milestones: v1.0.0, v1.1.0 Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acceptance: go ahead Reviewed, implementation can start area: result Improvements in query result reporting help wanted External contributions welcome type: feature New feature or request
Projects
Development

No branches or pull requests

1 participant