Integer/String Data Type

An str_int data type tests data for being an instance of python's built-in class int or class str and string must represent an integer value.

Data is converted to int by default. Use convert_to option to enforce conversion to other data types.

Features/Limitations

  • Validate minimal and maximal integer value
  • Validate against allowed and not allowed value ranges
  • Validate against allowed and not allowed integer values
  • Supports Referencing Feature

Integer/String Definition Syntax

Table

Key/Option Type Default Value Restrictions Description
type str 'str_int'
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:
- float
- str
minimum int|str Value must be greater or equal
maximum int|str >= 'minimum' Value must be lower or equal
allowed_ranges list[dict] min length: 1 Value must be within defined ranges
  - start int|str required
    end int|str required
not_allowed_ranges list[dict] Value mustn't be within defined ranges
  - start int|str required
    end int|str required
allowed_values list Data must match one of these values
  - < value > int|str Must match data type's type(s)
not_allowed_values list Data mustn't match all of these values
  - < value > int|str Must match data type's type(s)
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: str_int
description: <str>
default_value: <default_value>

convert_to: <float|str>
maximum: <int|str>
minimum: <int|str>
allowed_ranges:
 - start: <int|str>
   end: <int|str>
not_allowed_ranges:
 - start: <int|str>
   end: <int|str>
allowed_values:
  - <int|str>
not_allowed_values:
  - <int|str>

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: str_int
description: "Example str_int definition"

minimum: 1
maximum: 4096

not_allowed_values:
  - 1001
  - "1002"

reference:
  key: ref_key
  mode: consumer