fix: better validation error messages (#3736)

This commit is contained in:
Vlad Stan
2026-02-25 07:53:41 +01:00
committed by dni ⚡
parent f0f9e41f99
commit 67bb86c1ce
5 changed files with 35 additions and 16 deletions
+1 -1
View File
@@ -109,7 +109,7 @@ def register_exception_handlers(app: FastAPI): # noqa: C901
logger.error(f"RequestValidationError: {exc!s}")
return render_html_error(request, exc) or JSONResponse(
status_code=HTTPStatus.BAD_REQUEST,
content={"detail": str(exc)},
content={"detail": [dict(e) for e in exc.errors()]},
)
@app.exception_handler(HTTPException)