rougail/docs/user_data/example.yaml

53 lines
1.4 KiB
YAML

%YAML 1.2
---
version: 1.1
person: # Description of a person
firstname: # Last name of the person
lastnames: [] # Last names of the person
age:
description: Person's age
type: integer
params:
min_integer: 0
max_integer: 120
legal_age:
description: The person is of legal age
type: boolean
default:
jinja: |-
{{ _.age is not none and _.age >= 18 }}
hidden: true
drive_license:
description: The person has a driver's license
default: false
disabled:
variable: _.legal_age
when_not: true
means_of_transport:
description: Means of transport used by the person
choices:
- human-powered
- public transport
- electric-assisted vehicle
- engine-powered without a license
- engine-powered
- others
validators:
- jinja: |-
{% if _.means_of_transport == "engine-powered" %}
{% if _.drive_license is propertyerror %}
{{ _.lastnames[0] }} {{ _.firstname }} is not of legal age but declares that he uses an engine-powered
{% elif not _.drive_license %}
{{ _.lastnames[0] }} {{ _.firstname }} does not have a license but declares that he uses an engine-powered
{% endif %}
{% endif %}
description: Engine-powered are only permitted for individuals with a driver's license
...