Browse Source

Black

pull/10223/head
chbndrhnns 2 years ago
parent
commit
a26d4cafa2
  1. 2
      fastapi/_compat.py

2
fastapi/_compat.py

@ -98,6 +98,7 @@ if PYDANTIC_V2:
def __post_init__(self) -> None:
from pydantic import PydanticDeprecatedSince20
try:
self._type_adapter: TypeAdapter[Any] = TypeAdapter(
Annotated[self.field_info.annotation, self.field_info]
@ -129,6 +130,7 @@ if PYDANTIC_V2:
except AttributeError:
# pydantic v1
from pydantic import v1
try:
return v1.parse_obj_as(self.type_, value), None
except v1.ValidationError as exc:

Loading…
Cancel
Save