What is the purpose of tilde character ~ in YAML?

女生的网名这么多〃 提交于 2021-02-20 05:34:48

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!