diff --git a/components/yaml/yaml_format.rst b/components/yaml/yaml_format.rst index 08a76d4c2f8..2aab5ee8397 100644 --- a/components/yaml/yaml_format.rst +++ b/components/yaml/yaml_format.rst @@ -300,4 +300,22 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``): Comments are simply ignored by the YAML parser and do not need to be indented according to the current level of nesting in a collection. +Explicit Typing +--------------- + +The YAML specification defines some tags to set the type of any data explicitly: + +.. code-block:: yaml + + data: + # this value is parsed as a float number (it will be 3.0 instead of 3) + price: !!float 3 + + # this value is parsed as binary data encoded in base64 + picture: !!binary | + R0lGODlhDAAMAIQAAP//9/X + 17unp5WZmZgAAAOfn515eXv + Pz7Y6OjuDg4J+fn5OTk6enp + 56enmleECcgggoBADs= + .. _YAML: http://yaml.org/