From eb4f4c2aae9e66d47d8403c9f61e7310401feea6 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 1 Aug 2017 13:09:14 +0200 Subject: [PATCH 1/3] Mention the YAML features not supported by the Yaml component --- components/yaml/yaml_format.rst | 37 +++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/components/yaml/yaml_format.rst b/components/yaml/yaml_format.rst index 2aab5ee8397..925fa2417a5 100644 --- a/components/yaml/yaml_format.rst +++ b/components/yaml/yaml_format.rst @@ -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). 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); +* 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/``) + and global references to a tag (example: ``!``); +* Not having a key in a mapping (example: ``{foo, bar}``; use + ``{foo: ~, bar: ~}`` instead). + +.. _`YAML website`: http://yaml.org/ +.. _`YAML specification`: http://www.yaml.org/spec/1.2/spec.html From 2da64a7cd235a3b6bdf8ae343b787cc74b80d0b3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 6 Sep 2017 15:59:40 +0200 Subject: [PATCH 2/3] Fixes --- components/yaml/yaml_format.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/yaml/yaml_format.rst b/components/yaml/yaml_format.rst index 925fa2417a5..cadd2a60bc6 100644 --- a/components/yaml/yaml_format.rst +++ b/components/yaml/yaml_format.rst @@ -166,8 +166,8 @@ Collections ----------- A YAML file is rarely used to describe a simple scalar. Most of the time, it -describes a collection. YAML collections can be a sequence (scalar arrays in PHP) -or a mapping of elements (key/value arrays in PHP). +describes a collection. YAML collections can be a sequence (indexed arrays in PHP) +or a mapping of elements (associative arrays in PHP). Sequences use a dash followed by a space: @@ -318,14 +318,14 @@ Unsupported YAML Features The following YAML features are not supported by the Symfony Yaml component: -* Structures and multi-documents (``---`` and ``...`` markers); +* Multi-documents (``---`` and ``...`` markers); * 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/``) - and global references to a tag (example: ``!``); -* Not having a key in a mapping (example: ``{foo, bar}``; use +* Tags (``TAG`` directive; example: ``%TAG ! tag:example.com,2000:app/``) + and tag references (example: ``!``); +* Using sequence-like syntax for mapping elements (example: ``{foo, bar}``; use ``{foo: ~, bar: ~}`` instead). .. _`YAML website`: http://yaml.org/ From 4c47276ba98512c040d36c77c0e20b0b9f474578 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 7 Sep 2017 13:14:28 +0200 Subject: [PATCH 3/3] Fixed a syntax issue --- components/yaml/yaml_format.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/yaml/yaml_format.rst b/components/yaml/yaml_format.rst index cadd2a60bc6..9e4b8219778 100644 --- a/components/yaml/yaml_format.rst +++ b/components/yaml/yaml_format.rst @@ -323,7 +323,7 @@ The following YAML features are not supported by the Symfony Yaml component: * Tagged values as keys; * The following tags and types: `!!set`, `!!omap`, `!!pairs`, `!!set`, `!!seq`, `!!bool`, `!!int`, `!!merge`, `!!null`, `!!timestamp`, `!!value`, `!!yaml`; -* Tags (``TAG`` directive; example: ``%TAG ! tag:example.com,2000:app/``) +* Tags (``TAG`` directive; example: ``%TAG ! tag:example.com,2000:app/``) and tag references (example: ``!``); * Using sequence-like syntax for mapping elements (example: ``{foo, bar}``; use ``{foo: ~, bar: ~}`` instead).