-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC][Yaml] Consider colon not followed by spaces as a value #19874
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The first example you gave ( For the other examples you are right and we should look into how we can improve the parser to detect these edge cases. |
What about |
BTW the pomm bundle uses this pomm:
configuration:
my_db1:
dsn: 'pgsql://%db_user1%:%db_password1%@%db_host1%:%db_port1%/%db_name1%'
pomm:default: true
my_db2:
dsn: 'pgsql://%db_user2%:%db_password2%@%db_host2%:%db_port2%/%db_name2%'
class:session_builder: '\PommProject\ModelManager\SessionBuilder' so this should stay valid. |
@mvrhov i don't think this behaves as you expect. If i'm not wrong it is equivalent to |
ATM This comes out as expected |
@mvrhov actually mapping blocks are not managed the same way than the one inlined so that's possible it works as expected (and make the inline behavior even more weird). |
Is there still anything to do here? I mean can one of you give an example of a YAML string that would not be parsed as expected? |
|
@GuilhemN This example is not valid according to the spec. You would have to quote the key then. |
@xabbuh from what I see it is as long as |
@GuilhemN only if they are the first character in a plain string if I don't misunderstand to which part of the spec you refer to. |
I don't think so, i'll detail my research:
|
This PR was merged into the 3.2 branch. Discussion ---------- [Yaml] do not trigger deprecations for valid YAML | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19874 | License | MIT | Doc PR | Commits ------- 1436349 do not trigger deprecations for valid YAML
Uh oh!
There was an error while loading. Please reload this page.
According to the spec, colon not followed by flow indicators (
[]{},
) should be considered as part of the key and not throw an exception which is gonna be the 4.0 behavior according to the deprecation.For example,
foo:{foo:bar}
should be valid but it won't be in the current state.BTW we can also consider fixing other inconsistensies:
[]
is allowed in sf mapping values but not in the spec{fo[o: bar}
{}
is allowed in sf sequence values but not in the spec[fo{o}: quz]
:
(i.e.{value}
) is allowed and should be converted to{value: null}
(i fixed this one in [Yaml] Base the parser on a StringReader #19750, in 51b87f7)WDYT?
cc @xabbuh
The text was updated successfully, but these errors were encountered: