Skip to content

[Yaml] Duplicate keys not reported when key is defined with NULL value #57262

@olsavmic

Description

@olsavmic

Symfony version(s) affected

7+, 6+, 5+

Description

Duplicate keys are not valid by definition in YAML. The current implementation contains a bug that allows a key to be defined multiple times when the value is not set.

How to reproduce

services:
    Foo:
    Bar:
    Foo:

is invalid YAML but the YAML parser is fine with this.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions