yamlpath 1.24.0

Format-preserving YAML feature extraction
Documentation
testcase:
  foo:
    - # hello!
      bar: baz

  multiple:
    - # comment 1
      # comment 2
      bar: baz

  many-children:
    - # foo
      foo: bar
    - # bar
      bar: baz

  after-key: # hmm
    foo: bar

  after-key-nl:
    # hmm
    foo: bar

queries:
  - query: [foo, 0, bar]
    expected: "      bar: baz"

  - query: [multiple, 0, bar]
    expected: "      bar: baz"

  - query: [many-children, 1, bar]
    expected: "      bar: baz"

  - query: [after-key, foo]
    mode: exact
    expected: "bar"

  - query: [after-key-nl, foo]
    mode: exact
    expected: "bar"