IDList Data Type

An idlist data type represents a python dictionary with IDs as keys. It tests data for being an instance of python's built-in class dict.

Features/Limitations

  • Validate number of IDs/keys
  • Validate IDs/keys with nested data type definition
  • Supports Referencing Feature

IDList Definition Syntax

Table

Key/Option Type Default Value Restrictions Description
type str 'idlist'
description str Data type description
default_value Must match data type's type(s) Value used to set as default value
convert_to str Allowed values:
- str
minimum int min: 1 Data's length must be greater or equal
maximum int min: 1
>= 'minimum'
Data's length must be lower or equal
replace_empty_to any An empty input value will be replaced by this data
elements dict|str required List element's data type definition
  option 1 str List element's data type string (short definition)
  option 2 dict List element's data type definition
id dict|str 'str' ID's data type definition
  option 1 str ID's data type string (short definition)
  option 2 dict ID's data type definition
template str must be definded in schema Merge options from this template
template_merge_options dict Define schema-global template merge instructions
    recursive bool True Merge data type definition options in template options recursively.
If false, data type defintion options overwrites template options.
    list_merge str append_rp Allowed values:
- append
- append_rp
- prepend
- prepend_rp
- replace
How lists within options data should be merged.
reference dict|str
  option 1 str Reference keys (implies unique global mode)
  option 2 dict
  key str required
  mode str Allowed values:
- unique
- producer
- consumer
  unique_scope str Allowed values:
- global
- namespace
  producer_scope str Allowed values:
- global
- namespace
  consumer_scope str Allowed values:
- global
- namespace
  allow_orphan_producer bool True
  credit int 1 (if mode consumer) min: 0
references list[dict|str]
  - dict|str
    option 1 str Reference keys (implies unique global mode)
    option 2 dict
    key str required
    mode str Allowed values:
- unique
- producer
- consumer
    unique_scope str Allowed values:
- global
- namespace
    producer_scope str Allowed values:
- global
- namespace
    consumer_scope str Allowed values:
- global
- namespace
    allow_orphan_producer bool True
    credit int 1 (if mode consumer) min: 0
doc_value_name str Set value name for documentation

YAML

type: idlist
description: <str>
default_value: <default_value>

convert_to: <str>
maximum: <int>
minimum: <int>
replace_empty_to: <any>

elements: <dict|str>
  # Mulitype!!!
  <str>
  # or
  <dict>

id: <dict|str>
  # Mulitype!!!
  <str>
  # or
  <dict>

template: <str>
template_merge_options:
  recursive: <true|false>
  list_merge: <append|append_rp|prepend|prepend_rp|replace>

reference: <reference_definition>
  # Multitype!!!
  <str>
  # or:
  key: <str>
  mode: <unique|producer|consumer>
  unique_scope: <global|namespace>
  producer_scope: <global|namespace>
  consumer_scope: <global|namespace>
  allow_orphan_producer: <true|false>
  credits: <int>
references:
  - <reference_definition>
    # Multitype!!!
    <str>
    # or
    key: <str>
    mode: <unique|producer|consumer>
    unique_scope: <global|namespace>
    producer_scope: <global|namespace>
    consumer_scope: <global|namespace>
    allow_orphan_producer: <true|false>
    credits: <int>

doc_value_name: <str>

Example

type: idlist
description: |
  Example idlist definition for string IDs with integer values and
  enhanced referencing.
default_value:
  nadap: 1
  rulez!: 2

minimum: 2
maximum: 15

id:
  type: str
  reference: ref_key_id
elements:
  type: int
  reference: ref_key_element