Options controlling how strictly a component graph and its payloads
are validated — the reference ValidationConfig.
strict/0 (the default) requires a root component, forbids
dangling references and unreachable components, and rejects unknown
elements. relaxed/0 allows all of those, for streaming or partially
delivered surfaces.
:root_id— the entry component,"root"by default.:allow_orphan_components— components not reachable from the root are not an error.:allow_dangling_references— references to ids that do not exist are not an error.:allow_missing_root— a surface without its root component is not an error (every component is then a traversal start).:allow_unknown_elements— unknown component properties are tolerated by schema validation.:allowed_messages— when set, only these message action keys are accepted.:max_depth— logical component-tree depth limit;nilmeans the global limit (50).
Summary
Functions
Builds a config from options, starting from the strict preset.
The relaxed preset (orphans, dangling references, a missing root and unknown elements are all tolerated).
The strict preset (every check on).
Types
Functions
Builds a config from options, starting from the strict preset.
iex> A2UICore.Validation.Config.new(root_id: "main").root_id
"main"
@spec relaxed() :: t()
The relaxed preset (orphans, dangling references, a missing root and unknown elements are all tolerated).
iex> A2UICore.Validation.Config.relaxed().allow_missing_root
true
@spec strict() :: t()
The strict preset (every check on).
iex> A2UICore.Validation.Config.strict().allow_orphan_components
false