yaml-jsonpath
yaml-jsonpath copied to clipboard
Support for recursive descent with expressions and filter expressions
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
- Launch the web UI from the library
- Enter the YAML document from the bug description
- Paste in the selector "$..plugins[?(@.id<2)]" and click Execute and view no results
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.
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.