Templates

Templates can be used to define data type definitions and/or the corresponding options.

This templates can be used within the data type definitions under the root key or within the definition of Custom Data Types.

Example

Schema Definition:

custom_data_types:
  cdt_test:
    type: int
    template: min1_max10
root:
  type: dict
  keys:
    cdt: cdt_test
    str_min:
      type: str
      template: min1_max10
    str_regex:
      type: str
      template: min1_max10_regex
templates:
  min1_max10:
    minimum: 1
    maximum: 10
  min1_max10_regex:
    template: min1_max10
    regex_mode: true
    allowed_values:
      - test.*me

Will create this data schema for testing:

Variable Type Default Restrictions Description
cdt int min: 1
max: 10
str_min str min length: 1
max length: 10
str_regex str min length: 1
max length: 10
allowed regex patterns:
- test.*me
Regex match options: fullmatch