Skip to main content

Module validator

Module validator 

Source
Expand description

CRUDUI form validator (SPEC §2 G5→§3→§2 G1, JS Validator parity).

The third pass of the CRUDUI pipeline. It consumes a COMPOSED CRUDUI field model (the validate/design/behavior/options role slots) AFTER the compose pass has expanded $ref/$patch. Its field-model logic: (a) reading the validate slot (there is no rules key); (b) evaluating a rule value that is an expression OR a condition map (G1 — the condition is the value’s expression, never a separate key); and (c) visibility from design.show alone: a hidden field and its descendants are not evaluated (display_switch/display_target are forbidden keys, G1).

Byte-for-byte with the JS reference; the shared 4-language fixture tests/fixtures/validate/cases.json is the single source of truth. errors are collected in declaration/traversal order and NEVER reordered.

Structs§

ValidationError
A single validation error (JS ValidationError: path/field/rule/message/value).
ValidationResult
The validation result (JS { valid, errors, hidden }).
Validator
The CRUDUI validator over a composed spec.