DocuTray

Validation Types

Type definitions for Validation in the DocuTray Python SDK — request and response models, fields, and enums.

Types for document validation results (JSON Schema + DSL rules).

DSLDiagnostic

A syntax diagnostic for invalid DSL rules.

Fields:

  • column: int - 1-based column number.

  • line: int - 1-based line number.

  • message: str - Parser diagnostic (currently in Spanish).

  • model_config: Any

ValidationIssue

A single structured validation error or warning.

Fields:

  • code: Annotated[str, BeforeValidator(_to_str)] - Machine-readable issue code (e.g. "VALIDATION_ERROR").

  • details: Any - Additional rule-specific details (usually a dict).

  • field: Annotated[str | None, BeforeValidator(_field_path)] - Canonical path of the field (e.g. "items[0].total"); empty or None for the document root.

  • message: Annotated[str, BeforeValidator(_to_str)] - Human-readable description of the issue.

  • model_config: Any

  • rule: Annotated[str | None, BeforeValidator(_to_optional_str)] - Name of the rule that failed, when the issue comes from a rule.

  • severity: Annotated[ValidationSeverity | str | None, BeforeValidator(_to_optional_str)] - Issue severity. Unknown values are kept as plain strings.

  • source: Annotated[ValidationSource | str | None, BeforeValidator(_to_optional_str)] - Validation layer that produced the issue. Unknown values are kept as plain strings.

  • value: Any - The value that caused the issue, when available.

ValidationOutcome

Validation result attached to a successful conversion.

Fields:

  • errors: list[ValidationIssue] - Blocking issues.

  • model_config: Any

  • valid: bool - Whether the data conforms (warnings do not make it invalid).

  • warnings: list[ValidationIssue] - Non-blocking issues.

ValidationSystemFailure

Validation could not be completed; no internal details are exposed.

Fields:

  • model_config: Any

  • status: Literal['error'] - Always "error".

On this page