"""Pydantic schemas for tree markdown import/export."""
from pydantic import BaseModel


class TreeMarkdownExportResponse(BaseModel):
    """Response for markdown export endpoint."""
    markdown: str


class TreeMarkdownImportRequest(BaseModel):
    """Request body for markdown import endpoint."""
    markdown: str


class MarkdownValidationError(BaseModel):
    """A single validation error with location info."""
    line: int
    column: int
    message: str
    severity: str  # 'error' or 'warning'


class TreeMarkdownValidationResponse(BaseModel):
    """Response for markdown validation endpoint."""
    valid: bool
    errors: list[MarkdownValidationError]
    tree_structure: dict | None = None
    metadata: dict | None = None
