Expand description
IDL validation. This module owns the ValidationError catalog and the
validate entry point, which checks an Api against the library’s
Identity and builds the one Model every generator consumes. The
work is split across submodules: rules (name, type, and shape checks),
diagnostic (miette span attachment), and warnings (advisory lints).
Validation collects every rule violation before failing, so a document with several problems reports them all in one run rather than one per invocation.
Structs§
- Options
- Options for
validate_scoped. - Validation
Diagnostic - Diagnostic wrapper that attaches an optional source code snippet and a
best-effort byte range to a
ValidationErrorfor fancy rendering via miette. The wrapper delegateshelp()andcode()to the inner error while exposing its ownsource_codeandlabelsso the renderer can underline the offending identifier in the input. - Validation
Diagnostics - Every validation failure found in one pass, each wrapped as a
ValidationDiagnosticcarrying an optional source span.
Enums§
- Validation
Error - Every way an
Apican fail validation. - Validation
Warning - A non-fatal advisory emitted by
collect_warnings.
Functions§
- collect_
warnings - Walk every module (including nested submodules) and collect all advisory
warnings for
api. - validate
- Validate an
Apidocument against the library’sidentity, reporting every rule violation found, and build itsModel. - validate_
scoped - Validate
apiagainstidentityexactly likevalidate, withoptions, returning each violation with the declaration path that encloses it instead of a located diagnostic.