Skip to main content

validate_document

Function validate_document 

Source
pub fn validate_document(
    db: &impl Db,
    doc_file: TextFile,
    schema_file: Option<TextFile>,
) -> Result<ErrorReports, QueryError>
Expand description

Validate a document, optionally against a specific schema.

If schema_file is Some, validates against that explicit schema. If schema_file is None, resolves schema internally via $schema extension, workspace config, or file name heuristics.

This is the SSoT for document validation - used by CLI, web editor, and LSP.