mirror of https://github.com/tiangolo/fastapi.git
Change validation error type to RequestMalformedError
This commit is contained in:
parent
a3bd484b8c
commit
161185b416
|
|
@ -48,6 +48,7 @@ from fastapi.dependencies.utils import (
|
||||||
from fastapi.encoders import jsonable_encoder
|
from fastapi.encoders import jsonable_encoder
|
||||||
from fastapi.exceptions import (
|
from fastapi.exceptions import (
|
||||||
FastAPIError,
|
FastAPIError,
|
||||||
|
RequestMalformedError,
|
||||||
RequestValidationError,
|
RequestValidationError,
|
||||||
ResponseValidationError,
|
ResponseValidationError,
|
||||||
WebSocketRequestValidationError,
|
WebSocketRequestValidationError,
|
||||||
|
|
@ -350,7 +351,7 @@ def get_request_handler(
|
||||||
else:
|
else:
|
||||||
body = body_bytes
|
body = body_bytes
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
validation_error = RequestValidationError(
|
validation_error = RequestMalformedError(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"type": "json_invalid",
|
"type": "json_invalid",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue