Browse Source
Change validation error type to RequestMalformedError
pull/14400/head
Javier Sánchez Castro
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
1 deletions
-
fastapi/routing.py
|
|
|
@ -48,6 +48,7 @@ from fastapi.dependencies.utils import ( |
|
|
|
from fastapi.encoders import jsonable_encoder |
|
|
|
from fastapi.exceptions import ( |
|
|
|
FastAPIError, |
|
|
|
RequestMalformedError, |
|
|
|
RequestValidationError, |
|
|
|
ResponseValidationError, |
|
|
|
WebSocketRequestValidationError, |
|
|
|
@ -350,7 +351,7 @@ def get_request_handler( |
|
|
|
else: |
|
|
|
body = body_bytes |
|
|
|
except json.JSONDecodeError as e: |
|
|
|
validation_error = RequestValidationError( |
|
|
|
validation_error = RequestMalformedError( |
|
|
|
[ |
|
|
|
{ |
|
|
|
"type": "json_invalid", |
|
|
|
|