Skip to main content

Module validate

Module validate 

Source
Expand description

CRUDUI validation entry point (SPEC §2 pipeline).

Wires the three CRUDUI passes in order (G5 compose first → §3 traversal → §2 G1 value evaluation):

  1. compose — compose_spec / compose_properties expand $ref/$patch into a single spec. An unresolved composition returns Err(ComposeLoadError) HERE (a LOAD failure, NOT valid:false) — an unresolved $ref never yields valid:true.
  2. validate — Validator traverses the composed spec and runs the validate slot (conditional rule values evaluated by the CRUDUI expression engine, then handed to the rule registry).

The compose pass reuses the existing crate::compose module and the expression engine reuses crate::expr. Nothing re-implements them.

Re-exports§

pub use errors::FormInputError;
pub use errors::ValidateError;
pub use validator::ValidationError;
pub use validator::ValidationResult;
pub use validator::Validator;

Modules§

errors
Validation failures that produce no validation result.
group_source
Choices from a repeated group (schema.md, “Choices from a repeated group”).
numeric
Numbers (validation rules, “Values”): numeric text, numeric values and exact step multiples.
rules
CRUDUI validation rule registry (VALIDATION-RULES, JS rules/* parity).
validator
CRUDUI form validator (SPEC §2 G5→§3→§2 G1, JS Validator parity).
visibility
Visibility (validation rules, “Evaluation”): design.show resolved against the data in the field’s row context.

Structs§

ValidateOptions
Options for a CRUDUI validation run.

Functions§

validate
Validate data against a CRUDUI spec. The spec may carry $ref/$patch; they are expanded first via the compose pass. An unresolved composition or a rule parameter outside the validation-rule definitions returns Err(ValidateError::Load) and data with the wrong shape returns Err(ValidateError::Input); neither produces a validation result.