rougail-output-doc/tests/docs/no_namespace/04_7validators_variable_optional.md
2024-08-05 14:38:59 +02:00

5.7 KiB

Table of Contents

dictionaries/rougail/00-base.yml

---
version: '1.1'
general:  # a family
  int:
    description: a first number
    type: number
    validators:
      - type: jinja
        jinja: |
          {% if _.int == int2 %}
          int and int2 must be different
          {% endif %}          
        params:
          int2:
            type: variable
            variable: _.int2
            optional: true
        description: int and int2 must be different
      - type: jinja
        jinja: |
          {% if _.int == int3 %}
          int and int3 must be different
          {% endif %}          
        params:
          int3:
            type: variable
            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 mandatory
A first number.
Validators:
- int and int2 must be different.
- int and int3 must be different.
general.int2
number standard mandatory
A second number.
Default: 1

Example with mandatory variables not filled in

---
general:
  int: 42

Example with all variables modifiable

---
general:
  int: 42
  int2: 1