From a01a25cc2e11fd29984d7e6db7a92677afc43840 Mon Sep 17 00:00:00 2001 From: CC Worker Date: Sun, 7 Jun 2026 19:52:05 +0000 Subject: [PATCH] fix(exam): response_model=None on auto-map route (Union[dict,JSONResponse]) The auto-map endpoint returns dict (sync 200) or JSONResponse (202 async OCR); FastAPI cannot build a response model from that Union. Fixes import-time FastAPIError introduced with the S5-2 endpoint. Co-Authored-By: Claude Opus 4.8 --- routers/exam/templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/exam/templates.py b/routers/exam/templates.py index ab93f2f..4bb2171 100644 --- a/routers/exam/templates.py +++ b/routers/exam/templates.py @@ -686,7 +686,7 @@ async def get_template_source_pdf( return Response(content=pdf_bytes, media_type="application/pdf") -@router.post("/templates/{template_id}/auto-map") +@router.post("/templates/{template_id}/auto-map", response_model=None) async def auto_map_template( template_id: str, background_tasks: BackgroundTasks,