-
-
Notifications
You must be signed in to change notification settings - Fork 717
Closed
Description
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:
dummy: 42
<<:
foo: 123Command
yq eval '.bar' data1.yml
yq eval 'explode(.)' data1.yml
Actual behavior
.bar:
nullexplode(.):
dummy: 42Expected behavior
.bar:
123explode(.):
dummy: 42
foo: 123Additional 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.