You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have received the following error when I try to parse YAML document generated by YARD documentation tool. The custom tag (!ruby/object:YARDJS::CodeObjects::PropertyObject) in the YAML file has a reference to itself, but parser hasn't added it to the references registry yet thus throws the error.
PHP Fatal error: Uncaught Symfony\Component\Yaml\Exception\ParseException: Reference "1" does not exist at line 4 (near "object: *1"). in vendor/symfony/yaml/Parser.php:642
Stack trace:
#0 vendor/symfony/yaml/Parser.php(337): Symfony\Component\Yaml\Parser->parseValue('1', 512, 'mapping')
#1 vendor/symfony/yaml/Parser.php(454): Symfony\Component\Yaml\Parser->doParse('Constructs a se...', 512)
#2 vendor/symfony/yaml/Parser.php(315): Symfony\Component\Yaml\Parser->parseBlock(18, 'str: |-\n Const...', 512)
#3 vendor/symfony/yaml/Parser.php(454): Symfony\Component\Yaml\Parser->doParse(Array, 512)
#4 vendor/symfony/yaml/Parser.php(185): Symfony\Component\Yaml\Parser->parseBlock(10, 'files: []\ncurre...', 512)
#5 vendor/symfony/yaml/Parser.php(454): Symfony\Component\Yaml\Parser->doParse('- &1 !ruby/obje...', 512)
#6 vendor/symfony/yaml/Parser in vendor/symfony/yaml/Parser.php on line 642
Need to correct myself. The PropertyObject tag has a reference to the Docstring tag, that has a reference to the "parent" object. It's a kind of a circular reference.
So when the parser tries to parse docstring object it sees a link to *1 object that hasn't been added to the refs array yet. I think a solution might be to add an empty tag to the refs array when the parser encounters &{xxx} and then update its value when it finishes parsing it.
Symfony version(s) affected: symfony/yaml@^4.2
Description
I have received the following error when I try to parse YAML document generated by YARD documentation tool. The custom tag (
!ruby/object:YARDJS::CodeObjects::PropertyObject
) in the YAML file has a reference to itself, but parser hasn't added it to the references registry yet thus throws the error.How to reproduce
Just run:
The text was updated successfully, but these errors were encountered: