Describe the bug
When I use a merge key (<<:) with an inline map rather than an anchor, yq doesn't propagate keys to the parent map.
Version of yq: 4.45.4
Operating system: linux
Installed via: binary release
Input Yaml
data1.yml:
Command
yq eval '.bar' data1.yml
yq eval 'explode(.)' data1.yml
Actual behavior
.bar:
explode(.):
Expected behavior
.bar:
explode(.):
Additional context
Other YAML parsers seem fine with this, e.g. PyYAML (and online tools: https://www.yamllint.com/, https://jsonformatter.org/yaml-to-json). See also the spec.
I encountered this problem when implementing a custom !include tag using load(.), where exploding <<: !include "file.yml" wouldn't work.
Describe the bug
When I use a merge key (
<<:) with an inline map rather than an anchor,yqdoesn't propagate keys to the parent map.Version of yq: 4.45.4
Operating system: linux
Installed via: binary release
Input Yaml
data1.yml:
Command
Actual behavior
.bar:nullexplode(.):Expected behavior
.bar:123explode(.):Additional context
Other YAML parsers seem fine with this, e.g. PyYAML (and online tools: https://www.yamllint.com/, https://jsonformatter.org/yaml-to-json). See also the spec.
I encountered this problem when implementing a custom
!includetag usingload(.), where exploding<<: !include "file.yml"wouldn't work.