rougail-output-doc/tests/docs/no_namespace/04_7validators_variable_optional.md

5.5 KiB

Table of Contents

dictionaries/rougail/00-base.yml

---
version: '1.1'
general:  # a family
  int:
    description: a first number
    type: number
    test:
      - 5
    validators:
      - jinja: |
          {% if _.int == int2 %}
          int and int2 must be different
          {% endif %}          
        params:
          int2:
            variable: _.int2
            optional: true
        description: int and int2 must be different
      - jinja: |
          {% if int3 is defined and _.int == int3 %}
          int and int3 must be different
          {% endif %}          
        params:
          int3:
            variable: _.int3
            optional: true
        description: int and int3 must be different
  int2: 1  # a second number

Variables

a family

basic

Variable                                                                                                     Description                                                                                                 
general.int
number basic obligatoire
A first number.
Validators:
- int and int2 must be different.
- int and int3 must be different.
Exemple: 5
general.int2
number standard obligatoire
A second number.
Défaut: 1