-
I have the following YAML: foo: &foo
hello: world
bar:
<<: *foo And would like to compute the following values based on the "parent" of each object foo: &foo
parent: null
bar:
parent: foo # bar inherits from "foo", so the value of bar.parent should be "foo" I've tried the following filters, but can't seem to figure it out! filter attempt 1the following queries: with_entries(.value |= {
"parent": . | alias
}) with_entries(.value |= {
"parent": alias
}) produces foo: &foo
parent: ""
bar:
parent: "" # expected "foo" filter attempt 2with_entries(.value |= {
"parent": .["<<"]
}) produces foo: &foo
parent: null
bar:
parent: null filter attempt 3with_entries(.value |= {
"parent": (.["<<"] | alias)
}) produces foo: &foo
parent: "null"
bar:
parent: "null" Note that it works fine with anchors
produces foo: &foo
anchor_name: foo
bar:
anchor_name: ""
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think you found a bug! |
Beta Was this translation helpful? Give feedback.
Fixed in 4.41.1 via #1942