Symfony version(s) affected: 4.4.x (it works in 3.x as well as 4.x up to 4.3, 4.4 or greater is failing)
Description
Parsing inline Objects in YAML is broken since 4.4, see example script below.
How to reproduce
<?php
require __DIR__ . '/vendor/autoload.php';
$yaml = \Symfony\Component\Yaml\Yaml::parse(<<<YAML
data:
example:
{
"total": 2,
"apis": [
{
"apiKey": "oa_citations",
"apiVersionNumber": "v1",
},
{
"apiKey": "cancer_moonshot",
"apiVersionNumber": "v1",
}
]
}
YAML
);
print_r($yaml);
On yaml versions <4.4, it shows the correct parsing:
Array
(
[data] => Array
(
[example] => Array
(
[total] => 2
[apis] => Array
(
[0] => Array
(
[apiKey] => oa_citations
[apiVersionNumber] => v1
)
[1] => Array
(
[apiKey] => cancer_moonshot
[apiVersionNumber] => v1
)
)
)
)
)
since 4.4 I get the following error:
Fatal error: Uncaught Symfony\Component\Yaml\Exception\ParseException: Malformed inline YAML string: {
"total": 2,
"apis": [
{
"apiKey": "oa_citations",
"apiVersionNumber": "v1",
},
{
"apiKey": "cancer_moonshot",
"apiVersionNumber": "v1",
}
]
} at line 15 (near "}"). in /home/cebe/dev/layer5/layer5-ng/vendor-dev/cebe/php-openapi/vendor/symfony/yaml/Inline.php on line 300
Symfony\Component\Yaml\Exception\ParseException: Malformed inline YAML string: {
"total": 2,
"apis": [
{
"apiKey": "oa_citations",
"apiVersionNumber": "v1",
},
{
"apiKey": "cancer_moonshot",
"apiVersionNumber": "v1",
}
]
} at line 15 (near "}"). in /home/cebe/dev/layer5/layer5-ng/vendor-dev/cebe/php-openapi/vendor/symfony/yaml/Inline.php on line 300
Additional info
could be related to symfony/yaml@110e3e9 (#33658)
Symfony version(s) affected: 4.4.x (it works in 3.x as well as 4.x up to 4.3, 4.4 or greater is failing)
Description
Parsing inline Objects in YAML is broken since 4.4, see example script below.
How to reproduce
On yaml versions <4.4, it shows the correct parsing:
since 4.4 I get the following error:
Additional info
could be related to symfony/yaml@110e3e9 (#33658)