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?
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.
Items of a list in YAML are represented by preceding it with - (hyphen). Key value pairs in YAML are represented as <key>:<value> . YAML is case sensitive. YAML uses spaces and indentations to define document structure.
Anchors. YAML also has a GOTO statement so that the user can define an anchor to reference that value elsewhere. To represent an anchor in YAML code, use the ampersand (&) symbol, followed by the anchor name and an asterisk (*) when referencing that value.
YAML is a digestible data serialization language often used to create configuration files with any programming language. Designed for human interaction, YAML is a strict superset of JSON, another data serialization language. But because it's a strict superset, it can do everything that JSON can and more.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With