Skip to content

Yaml component can't parse JSON #31333

@ylixir

Description

@ylixir

Symfony version(s) affected: 4.2.4

Description
Yaml component can't parse simple JSON. JSON is valid Yaml.

How to reproduce

\Symfony\Component\Yaml\Yaml::parse("{\n \n}");

Additional context
I believe this has to do with bad whitespace assumptions.

Error message is

Uncaught Symfony\Component\Yaml\Exception\ParseException: Unable to parse at line 1 (near "{").

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