-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Mention the YAML features not supported by the Yaml component #8249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,11 @@ | |
The YAML Format | ||
=============== | ||
|
||
According to the official `YAML`_ website, YAML is "a human friendly data | ||
serialization standard for all programming languages". | ||
|
||
Even if the YAML format can describe complex nested data structure, this | ||
article only describes the minimum set of features needed to use YAML as a | ||
configuration file format. | ||
|
||
YAML is a simple language that describes data. As PHP, it has a syntax for | ||
simple types like strings, booleans, floats, or integers. But unlike PHP, it | ||
makes a difference between arrays (sequences) and hashes (mappings). | ||
According to the official `YAML website`_, YAML is "a human friendly data | ||
serialization standard for all programming languages". The Symfony Yaml | ||
component implements a subset of the `YAML specification`_. Specifically, it | ||
implements the minimum set of features needed to use YAML as a configuration | ||
file format. | ||
|
||
Scalars | ||
------- | ||
|
@@ -171,8 +166,8 @@ Collections | |
----------- | ||
|
||
A YAML file is rarely used to describe a simple scalar. Most of the time, it | ||
describes a collection. A collection can be a sequence or a mapping of | ||
elements. Both sequences and mappings are converted to PHP arrays. | ||
describes a collection. YAML collections can be a sequence (scalar arrays in PHP) | ||
or a mapping of elements (key/value arrays in PHP). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
Sequences use a dash followed by a space: | ||
|
||
|
@@ -318,4 +313,20 @@ The YAML specification defines some tags to set the type of any data explicitly: | |
Pz7Y6OjuDg4J+fn5OTk6enp | ||
56enmleECcgggoBADs= | ||
|
||
.. _YAML: http://yaml.org/ | ||
Unsupported YAML Features | ||
------------------------- | ||
|
||
The following YAML features are not supported by the Symfony Yaml component: | ||
|
||
* Structures and multi-documents (``---`` and ``...`` markers); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean by |
||
* Complex mapping keys and complex values starting with ``?``; | ||
* Tagged values as keys; | ||
* The following tags and types: `!!set`, `!!omap`, `!!pairs`, `!!set`, `!!seq`, | ||
`!!bool`, `!!int`, `!!merge`, `!!null`, `!!timestamp`, `!!value`, `!!yaml`; | ||
* Global tags (``TAG`` directive; example: ``%TAG ! tag:example.com,2000:app/``) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd remove |
||
and global references to a tag (example: ``!<tag:example.com,2000:app/foo>``); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* Not having a key in a mapping (example: ``{foo, bar}``; use | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about |
||
``{foo: ~, bar: ~}`` instead). | ||
|
||
.. _`YAML website`: http://yaml.org/ | ||
.. _`YAML specification`: http://www.yaml.org/spec/1.2/spec.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by
scalar arrays
. Perhapsnumerically-indexed arrays
would be better?