Skip to content

YamlDotNet merges anchor list in wrong order. #594

Closed
@Indomitable

Description

@Indomitable

Hello,

According the documentation: https://yaml.org/type/merge.html

Keys in mapping nodes earlier in the sequence override keys specified in later mapping nodes

Considering this example:

.first: &first
  x: 1
.second: &second
  x: 2

item:
  <<: [*second, *first]

element item.x should have value 2, but YamlDotNet produces value 1
Sample project can be found here: https://github.com/Indomitable/yaml-merge-bug
image

BR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions