Expand description
Diagnostic codes emitted by check_conformance.
Exposed as a module of pub const &str slugs so downstream tools
(lint UIs, doc generators) can reference them without matching on
string literals.
Constants§
- ARITY_
NON_ EMPTY - A collection slot declared non-empty
(
ChildSchema::non_empty) carried no elements. Declared-constraint violation, not a heuristic — plainMany/Mapslots keep their zero-or-more contract. - ARITY_
ONE - A
crate::Multiplicity::Oneslot did not carry exactly one child. - ARITY_
OPTIONAL - A
crate::Multiplicity::Optionalslot carried more than one child. - CHILD_
AS_ FIELD - A child slot appeared under
fields(structural mismatch). - DUPLICATE_
CHILD - A child slot name appeared more than once.
- DUPLICATE_
FIELD - A field name appeared more than once.
- DUPLICATE_
KEY - A keyed child slot (
crate::Multiplicity::Map) carried the same key more than once. The map the consumer asked for cannot hold both, and picking a winner silently would make the parse lossy — so the duplicate is an error at conformance time and atcrate::build_child_maptime. - FIELD_
AS_ CHILD - A payload field appeared under
children(structural mismatch). - FIELD_
TYPE - A payload field’s value could not be converted to the target
Rust type (serde deserialization failure or
FromStrfailure). - KEYED_
SLOT_ SHAPE - A child slot was placed in the wrong half of the tree: a slot
declared
crate::Multiplicity::Mapappeared under [ParseTree::children] (positional), or a slot declaredOne/Optional/Manyappeared under [ParseTree::keyed_children]. - KEYED_
SLOT_ UNSORTED - A keyed child slot’s entries were not in ascending key order.
[
ParseTree::keyed_children] documents sorted-by-key as the canonical form so that two front-ends producing the same document produce equal trees; this is that contract enforced rather than assumed. The JSON bridge sorts on ingest, so this fires only for hand-built or hand-rolled front-end trees. - MISSING_
FIELD - A field required by the schema is absent from the tree.
- UNKNOWN_
CHILD - The tree references a child slot the schema does not declare.
- UNKNOWN_
FIELD - The tree carries a field the schema does not declare.
- UNKNOWN_
MULTIPLICITY - A child slot’s multiplicity is a variant this build of
dsl-kit-parsedoes not recognise. Emitted from the catch-all arm required bycrate::Multiplicity’s#[non_exhaustive]contract when a future variant is added to the schema crate ahead of parse-side support. Not reachable in practice within the workspace (both crates are versioned in lockstep) but held as a first-class diagnostic so out-of-workspace consumers see a stable slug rather than a panic. - UNKNOWN_
VARIANT - Tree’s
variantdid not match anyVariantSchemain theNodeSchema.