Schema format
Schemas are stored as JSON in thepayload_schema column of the flows table. They define expected attributes and their types:
Supported formats
The gateway supports two schema formats: Simple format (recommended):Supported types
The gateway validates against these Python types:The
number and float types accept both integers and floats. Use int or integer if you need to enforce whole numbers only.Validation process
When a message arrives, the gateway validates it before processing:Validation rules
- All schema attributes are required: Every attribute defined in the schema must be present in the payload
- Type checking is strict: Values must match the expected Python type exactly
- Extra attributes are allowed: Payloads can contain additional attributes not in the schema
- Unknown types are ignored: If a schema type isn’t in
_TYPE_MAP, validation for that attribute is skipped
Validation examples
Valid payload
Schema:Valid with extra attributes
Payload:Missing required attribute
Payload:Missing attribute 'humidity' in payload
Type mismatch
Payload:Invalid type for 'temperature'. Expected 'float', got 'str'
Complex types
Schemas can define object and array types:The gateway validates that objects are dictionaries and arrays are lists, but does not validate their internal structure. Nested validation is not supported.