问题
I have looked into YAML official documentation and I have also gone through some tutorials.
I am working with Symfony and I like adding configurations with YAML. But I can't find any explanation for this tilde character ~
in YAML.
For example, see the code below:
firewalls:
# ...
main:
anonymous: ~
http_basic: ~
Sometimes, I removed this ~ character and I did not see any effect on logic. So what is the purpose of this tide character in YAML?
回答1:
The tilde is one of the ways the null value can be written. Most parsers also accept an empty value for null, and of course null
, Null
and NULL
.
These are defined in the first two lines of the regular expressions for the core schema tags in the YAML standard.
来源:https://stackoverflow.com/questions/51990175/what-is-the-purpose-of-tilde-character-in-yaml