tmux_schema
Validate schema-defined observations and normalize scalar values.
Source and package
- Qualified name
-
tmux_schema - Package
- libtmux_erlang
- Source
- apps/libtmux_erlang/src/tmux_schema.erl
- tmux_schema
-
Description#
Field names come from the generated registry, never record reflection or payload-created atoms. Text is validated UTF-8; byte fields preserve arbitrary binaries. Integer normalization uses the shared exact JSON integer range.
tmux_modelvalidates rows andtmux_filtervalidates criteria through this schema. The field reference lists fields and relationships.
Members12#
Common operations1#
- error_detail/0 typealias Structured boundary validation errors with a code and input path.
Other members11#
- entity/0 typealias The built-in tmux graph entities; window_link represents a session membership.
- field_metadata/0 typealias Generated field contract. stable is a versioned portable identity; wire is the JSON key. required controls construction and nullable permits known absence. format is present only for directly observed tmux fields; derived fields omit it. capture_codec identifies an admitted batched source encoding; its absence selects isolated reads for that entity. minimum tightens an integer field's lower bound. Field names themselves are the keys returned by
fields/1, not this map's wire or stable values. - field/2 function Look up one permitted field by its Erlang atom name. Unknown names return a tagged error; this does not turn input strings into atoms.
- fields/1 function Return generated field metadata for a known entity, or a tagged unknown_entity error. Field names, wire names and stable IDs are allowlisted; this is not reflection over arbitrary record fields.
- normalize/2 function Validate a domain-field map and normalize its scalar observations, retaining not_loaded/unavailable distinctly and deriving schema-defined values. Performs no I/O; constructors and action boundaries still validate records.
- operator/0 typealias Validated scalar operators. The field's type and nullability restrict this set.
- operators/1 function Return the permitted scalar operators for this field type and nullability. The generated field reference uses this same validator. Performs no I/O.
- relation_metadata/0 typealias Generated relationship contract: kind is one or many; target names the related entity. wire and stable have the same roles as in
field_metadata/0. Completeness belongs to snapshot coverage, not this static schema. - relations/1 function Return generated relationship metadata, including target entities and one/many cardinality. Performs no I/O.
- value_type/0 typealias Scalar categories used by normalization and operator validation; IDs remain binaries.
- value/2 function Validate and normalize one value against generated field metadata. Integral JSON numbers obey the exact shared integer range and field bounds; text is validated UTF-8, while bytes remain arbitrary binaries. Performs no I/O.
Guides#
Pages that discuss tmux_schema.