fix(request): incorrectly parse body for a form
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
from typing import Any
|
||||
|
||||
from fastapi import Request
|
||||
@@ -37,15 +36,4 @@ def BodyOrForm[T: BaseModel](model: type[T]):
|
||||
except ValidationError as e:
|
||||
raise RequestValidationError(e.errors())
|
||||
|
||||
dependency.__signature__ = inspect.signature( # pyright: ignore[reportFunctionMemberAccess]
|
||||
lambda x: None
|
||||
).replace(
|
||||
parameters=[
|
||||
inspect.Parameter(
|
||||
name=model.__name__.lower(),
|
||||
kind=inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
||||
annotation=model,
|
||||
)
|
||||
]
|
||||
)
|
||||
return dependency
|
||||
|
||||
Reference in New Issue
Block a user