8000 minor #8249 Mention the YAML features not supported by the Yaml compo… · symfony/symfony-docs@8af4575 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8af4575

Browse files
committed
minor #8249 Mention the YAML features not supported by the Yaml component (javiereguiluz)
This PR was squashed before being merged into the 2.7 branch (closes #8249). Discussion ---------- Mention the YAML features not supported by the Yaml component This fixes #6730 thanks to [this comment](#6730 (comment)) from @GuilhemN. Commits ------- eeaeac1 Mention the YAML features not supported by the Yaml component
2 parents 6a9b74b + eeaeac1 commit 8af4575

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

components/yaml/yaml_format.rst

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
The YAML Format
55
===============
66

7-
According to the official `YAML`_ website, YAML is "a human friendly data
8-
serialization standard for all programming languages".
9-
10-
Even if the YAML format can describe complex nested data structure, this
11-
article only describes the minimum set of features needed to use YAML as a
12-
configuration file format.
13-
14-
YAML is a simple language that describes data. As PHP, it has a syntax for
15-
simple types like strings, booleans, floats, or integers. But unlike PHP, it
16-
makes a difference between arrays (sequences) and hashes (mappings).
7+
According to the official `YAML website`_, YAML is "a human friendly data
8+
serialization standard for all programming languages". The Symfony Yaml
9+
component implements a subset of the `YAML specification`_. Specifically, it
10+
implements the minimum set of features needed to use YAML as a configuration
11+
file format.
1712

1813
Scalars
1914
-------
@@ -171,8 +166,8 @@ Collections
171166
-----------
172167

173168
A YAML file is rarely used to describe a simple scalar. Most of the time, it
174-
describes a collection. A collection can be a sequence or a mapping of
175-
elements. Both sequences and mappings are converted to PHP arrays.
169+
describes a collection. YAML collections can be a sequence (indexed arrays in PHP)
170+
or a mapping of elements (associative arrays in PHP).
176171

177172
Sequences use a dash followed by a space:
178173

@@ -318,4 +313,20 @@ The YAML specification defines some tags to set the type of any data explicitly:
318313
Pz7Y6OjuDg4J+fn5OTk6enp
319314
56enmleECcgggoBADs=
320315
321-
.. _YAML: http://yaml.org/
316+
Unsupported YAML Features
317+
-------------------------
318+
319+
The following YAML features are not supported by the Symfony Yaml component:
320+
321+
* Multi-documents (``---`` and ``...`` markers);
322+
* Complex mapping keys and complex values starting with ``?``;
323+
* Tagged values as keys;
324+
* The following tags and types: `!!set`, `!!omap`, `!!pairs`, `!!set`, `!!seq`,
325+
`!!bool`, `!!int`, `!!merge`, `!!null`, `!!timestamp`, `!!value`, `!!yaml`;
326+
* Tags (``TAG`` directive; example: ``%TAG ! tag:example.com,2000:app/``)
327+
and tag references (example: ``!<tag:example.com,2000:app/foo>``);
328+
* Using sequence-like syntax for mapping elements (example: ``{foo, bar}``; use
329+
``{foo: ~, bar: ~}`` instead).
330+
331+
.. _`YAML website`: http://yaml.org/
332+
.. _`YAML specification`: http://www.yaml.org/spec/1.2/spec.html

0 commit comments

Comments
 (0)
0