Files
familienarchiv/ocr-service/models.py
Marcel 838330b405
Some checks failed
CI / Unit & Component Tests (push) Failing after 1s
CI / Backend Unit Tests (push) Failing after 1s
CI / Unit & Component Tests (pull_request) Failing after 1s
CI / Backend Unit Tests (pull_request) Failing after 1s
fix(ocr): use camelCase field names in Pydantic models
Pydantic v2 Field(alias=...) doesn't work with FastAPI as expected.
The Java client sends camelCase (pdfUrl, scriptType, pageNumber).
Use camelCase field names directly instead of aliases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-12 23:04:42 +02:00

22 lines
424 B
Python

from pydantic import BaseModel, ConfigDict
class OcrRequest(BaseModel):
model_config = ConfigDict(populate_by_name=True)
pdfUrl: str
scriptType: str = "UNKNOWN"
language: str = "de"
class OcrBlock(BaseModel):
model_config = ConfigDict(populate_by_name=True)
pageNumber: int
x: float
y: float
width: float
height: float
polygon: list[list[float]] | None = None
text: str