Open sergeyrud-stripe opened 1 year ago
Is it possible to opt in to following aliases when looking for nodes? For instance, if I have the following path $.production.foo and YAML structure
$.production.foo
default: &default foo: bar production: <<: *default
I’d like to get the bar node without changing the path from $.production.foo to $.default.foo.
bar
$.default.foo
API could possibly be as follows:
const data = ` default: &default foo: bar production: <<: *default ` var node yaml.Node yaml.Unmarshal([]byte(data), &node) p, _ := yamlpath.NewPath("$.production.foo") p.FollowAliases(true) // new func that toggles this behaviour. nodes, _ := p.Find(&node)
No response
Is your feature request related to a problem? Please describe.
Is it possible to opt in to following aliases when looking for nodes? For instance, if I have the following path
$.production.foo
and YAML structureI’d like to get the
bar
node without changing the path from$.production.foo
to$.default.foo
.Describe the solution you'd like
API could possibly be as follows:
Describe alternatives you've considered
No response
Additional context
No response