Skip to content

Nested merge key with inline map broken #2679

@stevenwdv

Description

@stevenwdv

(I finally took some time to submit some bugs with regard to the merge of #2400)

Describe the bug

Nested inline merge keys are broken. For an yq script I have it'd be really useful to have these work!

Version of yq: 4.53.2

Command
The command you ran:

echo '{<<: {<<: {a: 42}}}' | yq --yaml-fix-merge-anchor-to-spec 'explode(.)'

Actual behaviour

{}

Expected behaviour

{a: 42}

Additional context

Related to #2386.

This was fixed in #2400, but broke following a change of the order of merged keys before merge. I see that I documented the cause (fixedReconstructAliasedMap) there.

The issue seems to only affect explode, not traverse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions