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

Support for recursive descent with expressions and filter expressions #54

Open
rspurgeon opened this issue Jul 21, 2023 · 1 comment
Open
Labels
bug Something isn't working

Comments

@rspurgeon
Copy link

Describe the bug

Given the following input:

plugins:
- config:
    do: rae
    foo: bar
  id: 1
  name: abc
- config:
    do: so
    foo: bar
  id: 2
  name: xyz
services:
- name: my-service
  plugins:
  - config:
      do: rae
      foo: special
    id: 3
    name: abc
- name: my-service
  plugins:
  - config:
      do: false
      foo: bar
    id: 4
    name: rst

This selector:

$.plugins[?(@.id<2)]

returns the expected

name: abc
id: 1
config:
  foo: bar
  do: rae

When introducing recursive descent, no results are returned

$..plugins[?(@.id<2)]

Reproduction steps

  1. Launch the web UI from the library
  2. Enter the YAML document from the bug description
  3. Paste in the selector "$..plugins[?(@.id<2)]" and click Execute and view no results
Screenshot 2023-07-21 at 10 18 42 AM Screenshot 2023-07-21 at 10 18 51 AM

Expected behavior

Filters should work with recursive descent according to https://goessner.net/articles/JsonPath/

Additional context

Thank you for this library, any advice on using this library with these features appreciated.

@rspurgeon rspurgeon added the bug Something isn't working label Jul 21, 2023
@zostay
Copy link
Contributor

zostay commented Oct 28, 2023

I am in the progress of hunting this down this bug to squash it. It is an obstacle to a project I'm currently working on related to my OpenAPI work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants