You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I know, I know. Merge operator is no longer supported in YAML 1.2, though its use is still widespread.
What I can't wrap my head around is role of indentation when using <<:.
Is there a 'correct' level of indent that is expected? Why is foo in the example evaluated to an empty object?
Version of yq: 4.42.1
Operating system: linux
Installed via: github release binary
Input Yaml
---
foo:
<<:
x: 1y: 2bar:
<<:
x: 1y: 2
Command
yq e 'explode(.)' data.yml
Actual behavior
---
foo: {}bar:
x: 1y: 2
Expected behavior
---
foo:
x: 1y: 2bar:
x: 1y: 2
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Under foo you're making x:1\ny:2 children of the merge anchor. The merge anchor format however is to provide a list of yaml aliases, which there are none, and so foo is effectively empty.
Describe the bug
I know, I know. Merge operator is no longer supported in YAML 1.2, though its use is still widespread.
What I can't wrap my head around is role of indentation when using
<<:
.Is there a 'correct' level of indent that is expected? Why is
foo
in the example evaluated to an empty object?Version of yq: 4.42.1
Operating system: linux
Installed via: github release binary
Input Yaml
Command
yq e 'explode(.)' data.yml
Actual behavior
Expected behavior
Additional context
N/A
The text was updated successfully, but these errors were encountered: