Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Yaml] parse omitted inlined mapping values as null#21118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
GuilhemN commentedJan 1, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Happy new year ! Best wishes :) About your change, why not replacing the |
xabbuh commentedJan 1, 2017
Happy new year for you too! :)
That's indeed much better. I updated the code accordingly. |
GuilhemN commentedJan 1, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Having a |
fabpot commentedFeb 16, 2017
xabbuh commentedFeb 16, 2017
@GuilhemN@fabpot As far as I understand the specs the key cannot be omitted in a mapping and it will never be treated as a boolean value (correct me if I am wrong). The YAML parser athttp://yaml-online-parser.appspot.com/ seem to confirm this. |
9692f38 to8103249Comparefabpot commentedFeb 16, 2017
@xabbuh I think that's exactly the problem mentioned by@GuilhemN You can add the following test, which is valid YAML (and works great): 'empty key is allowed' =>array('{"": "foo"}',array("" =>"foo")), But this one should fail (but it does not): 'null key is not allowed' =>array('{: "foo"}',array(null =>"foo")), |
8103249 to10e1523Comparexabbuh commentedFeb 17, 2017
That's indeed an issue. I opened#21643 to fix this in older maintained versions too (this one should be merged into |
fabpot commentedMar 1, 2017
@xabbuh Can you rebase and add a note in the CHANGELOG? |
xabbuh commentedMar 1, 2017
done |
fabpot commentedMar 1, 2017
Thank you@xabbuh. |
…abbuh)This PR was merged into the 3.3-dev branch.Discussion----------[Yaml] parse omitted inlined mapping values as null| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#20841 (comment)| License | MIT| Doc PR |As@GuilhemN mentioned in#20841 (comment) when using the inline YAML notation, it is currently not possible to completely omit the mapping value to have it parsed as `null` (you have to pass `~` or `null` explicitly).Commits-------c473504 parse omitted inlined mapping values as null
…agi)This PR was merged into the 3.3-dev branch.Discussion----------[Yaml] Fix legacy support for omitting mapping key| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | N/A| License | MIT| Doc PR | N/AQuick and dirty fix for the failing legacy `InlineTest::testOmittedMappingKeyIsParsedAsColon()` test (failing since#21118).Ping@xabbuh : I'm not used to the yaml component codebase and it's probably not the most pleasant one to read. 😄 So if you think there is a cleaner way to go, please just close this one in favor of yours.Commits-------d246f2f [Yaml] Fix legacy support for omitting mapping key
As@GuilhemN mentioned in#20841 (comment) when using the inline YAML notation, it is currently not possible to completely omit the mapping value to have it parsed as
null(you have to pass~ornullexplicitly).