Skip to content

[YAML] BC breaking bug: handling of merges #11142

Closed
@Tobion

Description

@Tobion

According to http://yaml.org/type/merge.html one can overwrite keys of merged maps. But since #10902 this does not work anymore, which makes merging with anchors useless.

Example YAML.

- key-with-duplicate: &alias1
    foo: bar
    foo: ignore

- key-without-duplicate: &alias2
    foo: other

- changed-value-before-merge:
    foo: overwrite
    << : *alias1

- changed-value-after-merge:
    << : *alias1
    foo: overwrite

- multiple-merges-as-repeat:
    << : *alias1
    << : *alias2

- multiple-merges-as-array:
    << : [*alias1, *alias2]

I tested http://yaml-online-parser.appspot.com/ and http://yamltojson.com/ and http://nodeca.github.io/js-yaml/ and none of them works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions