Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[YAML] Defining a reference on a merge key does not work. #23587

Copy link
Copy link
Closed
@magnusnordlander

Description

@magnusnordlander
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version all

In other YAML implementations, it is possible to define a reference on a merge key, e.g. as follows:

root:
    mergekeyrefdef:
        a: foo
        <<: &quux
            b: bar
            c: baz
    mergekeyderef:
        d: quux
        <<: *quux

This should be parsed as the following data structure:

    array(
        'mergekeyrefdef' => array('a' => 'foo', 'b' => 'bar', 'c' => 'baz'),
        'mergekeyderef' => array('d' => 'quux', 'b' => 'bar', 'c' => 'baz')
    )

However, in all Symfony versions, this emits the following error:

Symfony\Component\Yaml\Exception\ParseException: YAML merge keys used with a scalar value instead of an array at line 4 (near "<<: &quux").

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.