mirror of
https://github.com/fastapi/fastapi.git
synced 2026-02-07 04:41:24 -05: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,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