Skip to main content

Module compose

Module compose 

Source
Expand description

CRUDUI composition engine — SPEC §5, G5.

The parser’s first pass: expand $ref (base inheritance) then $patch (add/remove/replace + deep-path set) into a single, composition-free spec, BEFORE the field layer / validation / render. Unresolved composition is a LOAD ERROR (ComposeLoadError) — never valid:true.

Byte-for-byte parity with the JS reference engine (packages/validator/ts/src/compose); the shared 4-language fixture tests/fixtures/compose/cases.json is the single source of truth.

Re-exports§

pub use compose::compose_properties;
pub use compose::compose_spec;
pub use compose::ComposeOptions;
pub use errors::ComposeErrorCode;
pub use errors::ComposeLoadError;
pub use errors::ComposeResult;
pub use loader::FileLoader;
pub use loader::LoadedDoc;
pub use loader::MemoryLoader;
pub use member_order::member_ordered;
pub use member_order::member_ordered_map;
pub use patch::apply_patch;
pub use ref_::resolve_ref;

Modules§

compose
Composition orchestrator (SPEC §5, G5) — the parser’s FIRST pass.
errors
Composition load errors (SPEC §5, §7; unresolved_behavior).
loader
File loader for $ref resolution.
member_order
Specification member order (docs/spec/schema.md, “Member order”).
patch
$patch application — add / remove / replace over the $ref base (SPEC §5). There are no $after/$before/$merge/$change/$remove directives; $patch is the only overlay.
ref_
$ref resolution expands base inheritance before other composition (SPEC §5).