init repo
This commit is contained in:
19
app/schemas/convert.py
Normal file
19
app/schemas/convert.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Request and response schemas for markdown to DOCX conversion endpoint."""
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
class MarkdownToDocxRequest(BaseModel):
|
||||
"""Request body for markdown to DOCX conversion endpoint."""
|
||||
|
||||
markdown: str = Field(..., description="Markdown content to convert")
|
||||
filename: str | None = Field(None, description="Optional output filename (without extension)")
|
||||
|
||||
@field_validator("markdown")
|
||||
@classmethod
|
||||
def validate_markdown_not_empty(cls, v: str) -> str:
|
||||
"""Validate that markdown content is not empty."""
|
||||
if not v or not v.strip():
|
||||
raise ValueError("Markdown content cannot be empty")
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user