docs(fix): sequence

This commit is contained in:
egarette@silique.fr 2026-06-13 19:16:24 +02:00
parent c733743048
commit 335e971aea
3 changed files with 31 additions and 7 deletions

View file

@ -24,6 +24,8 @@ Variable with multiple values
git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git git clone https://forge.cloud.silique.fr/stove/rougail-tutorials.git
git switch --detach v1.1_110 git switch --detach v1.1_110
.. _tutorial_not_mandatory_list:
A conditional disabled non mandatory variable with type domainname and parameters A conditional disabled non mandatory variable with type domainname and parameters
----------------------------------------------------------------------------------- -----------------------------------------------------------------------------------
@ -101,6 +103,14 @@ We then have this output:
We can see the address for which proxy will be desactivated in the output. We can see the address for which proxy will be desactivated in the output.
.. note::
We had said that a variable with a mandatory parameter set to false was a :ref:`nullable variable <tutorial_nullable>`.
This is true only for a non :term:`multi` variable.
The value of a :term:`multi` variable which is not :term:`mandatory` will allow the empty list `[]`.
The :term:`mandatory` properties does not means that the `null` value is acceptable (that is the `empty` properties).
A variable with multiple values A variable with multiple values
----------------------------------- -----------------------------------
@ -218,10 +228,6 @@ Now we have this output:
A multi is a multiple variable, that is a variable that can have multiple values. A multi is a multiple variable, that is a variable that can have multiple values.
.. note:: Note that the value of a :term:`multi` variable which has no default value set and which is not :term:`mandatory`
will be the empty list `[]`
The :term:`mandatory` properties does not means that the `null` value is acceptable (that is the `empty` properties).
.. keypoints:: Key points .. keypoints:: Key points
We have now some kind of a container facility named `multi`, that can be applied We have now some kind of a container facility named `multi`, that can be applied

View file

@ -1,3 +1,5 @@
.. _tutorial_nullable:
Nullable variable Nullable variable
========================== ==========================

View file

@ -69,8 +69,24 @@ Here is the structure file associated with this use case:
Unsurprisingly, the way to assign the `sequence` type is done with the help of the `type` parameter. Unsurprisingly, the way to assign the `sequence` type is done with the help of the `type` parameter.
We see here that `proxies` is a family because it contains the variables `title` and `color`. We see here that `proxies` is a family because it contains the variables `title` and `color`.
The :term:`sequence` type ensures that in the `proxies` family, if a proxy type is specified, then an associated color will also be specified. There is nothing new to say to this two variable:
Let's launch the Rougail CLI on this structured data:
- `title` is not mandatory string
- `color` is just a string
.. note::
The first variable of the :term:`sequence` is not mandatory.
This does not mean that the variable is :ref:`tutorial_nullable` or that the :ref:`list is empty <tutorial_not_mandatory_list>`.
In this case, that means that the sequence is empty.
Which we could write in JSON like this:
.. code-block:: json
[]
Now configure the sequence:
.. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_190/config/02/config.yml .. extinclude:: https://forge.cloud.silique.fr/stove/rougail-tutorials/raw/commit/v1.1_190/config/02/config.yml
:language: yaml :language: yaml
@ -214,7 +230,7 @@ and which contain the same number of elements:
Sequence. Sequence.
We saw a :term:`sequence` type family, which full name is :ref:`Sequence of homogeneous elements <sequence_family>`. We saw a :term:`sequence` type family, which full name is :ref:`Sequence of homogeneous elements <sequence_family>`.
**comments** **Comments**
What is remarkable here is that we are dealing with a new form of :term:`consistency` What is remarkable here is that we are dealing with a new form of :term:`consistency`
which focuses on variables that are similar within a family, which focuses on variables that are similar within a family,