Skip to content

Commit 22ceb61

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Explained the explicit typing in YAML documents
2 parents 6737f80 + 712fd4c commit 22ceb61

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/yaml/yaml_format.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,22 @@ Comments can be added in YAML by prefixing them with a hash mark (``#``):
300300
Comments are simply ignored by the YAML parser and do not need to be
301301
indented according to the current level of nesting in a collection.
302302

303+
Explicit Typing
304+
---------------
305+
306+
The YAML specification defines some tags to set the type of any data explicitly:
307+
308+
.. code-block:: yaml
309+
310+
data:
311+
# this value is parsed as a float number (it will be 3.0 instead of 3)
312+
price: !!float 3
313+
314+
# this value is parsed as binary data encoded in base64
315+
picture: !!binary |
316+
R0lGODlhDAAMAIQAAP//9/X
317+
17unp5WZmZgAAAOfn515eXv
318+
Pz7Y6OjuDg4J+fn5OTk6enp
319+
56enmleECcgggoBADs=
320+
303321
.. _YAML: http://yaml.org/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy