Skip to content

[Yaml] Add an option to dump null as tilde #26717

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

Closed
wants to merge 2 commits into from

Conversation

fancyweb
Copy link
Contributor

@fancyweb fancyweb commented Mar 30, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #26497
License MIT
Doc PR symfony/symfony-docs#9525

I think it would be great to add this as the tilde is commonly used.

@javiereguiluz
Copy link
Member

I have a question so I can give a better opinion about this. Is there any technical reason to justify this proposal or is it just about personal preference? Thanks!

Examples of technical reasons: well-known third party libraries don't parse null and only ~ or in some previous YAML official spec the null value is not supported, etc.

@fancyweb
Copy link
Contributor Author

From my point of view, this is just about personal preference. But a personal preference coming from Symfony. I first used YAML for Symfony configuration and discovered its syntax through Symfony documentation. In most pages, the tilde is used to represent null (look at the reference configuration for bundles for examples). For a long time, I didn't even know it could also be represented with the null keyword. Using the tilde is now an habit. This is why I thought @soullivaneuh idea was great to add as an option.

@fabpot
Copy link
Member

fabpot commented Mar 31, 2018

I don't think this is needed. Both are equivalent.

@fabpot fabpot closed this Mar 31, 2018
@fancyweb fancyweb deleted the yaml-dump-null-as-tilde branch March 31, 2018 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants