mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-21 04:52:40 +00:00
Chore: describe the zone OCR responses in the API schema
The run status and skip reason were string literals, and the test zone and 404 bodies had no schema. Add enums and response serializers for them. The JSON is unchanged.
This commit is contained in:
1 parent
8f1a6d21ce
commit
246f4e53b1
4 files changed
+152
-14
No files matched your search
@@ -125,6 +125,19 @@ class ZoneOcrReason(StrEnum):
|
||||
TEMPLATE_FAILED = "template_failed"
|
||||
|
||||
|
||||
class ZoneOcrRunStatus(StrEnum):
|
||||
"""The overall outcome of a zone OCR run on one document."""
|
||||
|
||||
COMPLETED = "completed"
|
||||
SKIPPED = "skipped"
|
||||
|
||||
|
||||
class ZoneOcrSkipReason(StrEnum):
|
||||
"""Why a zone OCR run on one document was skipped."""
|
||||
|
||||
NO_TEMPLATE = "no_template"
|
||||
|
||||
|
||||
@dataclass(kw_only=True, slots=True)
|
||||
class ZoneOcrResult:
|
||||
template: str
|
||||
|
||||
Reference in new issue
Block a user