chyh1990 / yaml-rust

A pure rust YAML implementation.
Apache License 2.0
601 stars 138 forks source link

Dynamically choosing a YAML document path? #194

Open mzagrabe opened 1 year ago

mzagrabe commented 1 year ago

Greetings,

Thank you for yaml-rust!

I see in the docs:

assert_eq!(doc["foo"][0].as_str().unwrap(), "list1");

I would like to do something like:

let key = "[foo][0]";
assert_eq!(doc.dynamic_lookup(key).unwrap(), "list1");

Do you know if it is possible with yaml-rust?

Thanks!

volfco commented 9 months ago

https://github.com/ejrh/yaml-path