sm-moore / yaml-path

4 stars 4 forks source link

Missing list index number in the path #4

Open MurzNN opened 9 months ago

MurzNN commented 9 months ago

The path generates well with dict items, but with lists items it misses the numeric index of it. For example:

ingress:
  main:
    hosts:
      -  host: host1
      -  host: host2
      -  host: host3

And the last key should generate the path ingress.main.hosts.2.host (or ingress.main.hosts[2].host?) but the extension generates just ingress.main.hosts.host. Could you please fix this? Thanx!

rickyzhang82 commented 6 months ago

@MurzNN

Interesting. I googled a plugin that work for finding the path in YAML. I found the similar problem from another plugin I tried: https://github.com/shanmuganathan-balaraman/jsonyamlkeynavigator/issues/6

Have you found a better one so far?