Skip to main content

Module codes

Module codes 

Source
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 — plain Many / Map slots keep their zero-or-more contract.
ARITY_ONE
A crate::Multiplicity::One slot did not carry exactly one child.
ARITY_OPTIONAL
A crate::Multiplicity::Optional slot 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 at crate::build_child_map time.
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 FromStr failure).
KEYED_SLOT_SHAPE
A child slot was placed in the wrong half of the tree: a slot declared crate::Multiplicity::Map appeared under [ParseTree::children] (positional), or a slot declared One / Optional / Many appeared 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-parse does not recognise. Emitted from the catch-all arm required by crate::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 variant did not match any VariantSchema in the NodeSchema.