Custom Data Types

The custom data type feature allows definition of data types on base of built-in data types within schema definition. Customization means pre-defining data type definition option.

The name of the custom data type can be used as short or extended data type definitions within the data structure.

Features/Limitations

  • Nesting a custom data type within a custom data type is not support.
  • In extended data type definitions, options from custom data type can be overwritten. Merging of options is not supported. If merging of options is required, see Template Feature.
  • Using templates within custom data type definition is allowed. Use with caution! Template can be overwritten in extended data type definition.

Example

Schema Definition:

custom_data_types:
  cdt_test:
    type: int
    minimum: 1
    maximum: 100
root:
  type: dict
  keys:
    plain_cdt: cdt_test
    overwritten_cdt:
      type: cdt_test
      minimum: 10
    enriched_cdt:
      type: cdt_test
      not_allowed_values: [10, 20]

Will create this data schema for testing:

Variable Type Default Restrictions Description
plain_cdt int min: 1
max: 100
overwritten_cdt int min: 10
max: 100
enriched_cdt int min: 1
max: 100
not allowed values:
- 10
- 20