mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-07 02:31:28 -04:00
⬆️ Upgrade Starlette supported version range to >=0.40.0,<0.49.0 (#14077)
Co-authored-by: svlandeg <svlandeg@github.com>
This commit is contained in:
1 parent
938dd045fd
commit
7563579dc8
5 files changed
+7
-8
No files matched your search
@@ -1,4 +1,4 @@
|
||||
from fastapi import FastAPI, Request, status
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.encoders import jsonable_encoder
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import JSONResponse
|
||||
@@ -10,7 +10,7 @@ app = FastAPI()
|
||||
@app.exception_handler(RequestValidationError)
|
||||
async def validation_exception_handler(request: Request, exc: RequestValidationError):
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
status_code=422,
|
||||
content=jsonable_encoder({"detail": exc.errors(), "body": exc.body}),
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user