pre-commit-ci-lite[bot]
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
3 additions and
3 deletions
-
fastapi/encoders.py
-
fastapi/openapi/utils.py
|
|
|
@ -22,7 +22,7 @@ from annotated_doc import Doc |
|
|
|
from fastapi.exceptions import PydanticV1NotSupportedError |
|
|
|
from fastapi.types import IncEx |
|
|
|
from pydantic import BaseModel |
|
|
|
from pydantic.color import Color # ty: ignore[deprecated] |
|
|
|
from pydantic.color import Color # ty: ignore[deprecated] |
|
|
|
from pydantic.networks import AnyUrl, NameEmail |
|
|
|
from pydantic.types import SecretBytes, SecretStr |
|
|
|
from pydantic_core import PydanticUndefinedType |
|
|
|
@ -67,7 +67,7 @@ def decimal_encoder(dec_value: Decimal) -> int | float: |
|
|
|
|
|
|
|
ENCODERS_BY_TYPE: dict[type[Any], Callable[[Any], Any]] = { |
|
|
|
bytes: lambda o: o.decode(), |
|
|
|
Color: str, # ty: ignore[deprecated] |
|
|
|
Color: str, # ty: ignore[deprecated] |
|
|
|
datetime.date: isoformat, |
|
|
|
datetime.datetime: isoformat, |
|
|
|
datetime.time: isoformat, |
|
|
|
|
|
|
|
@ -247,7 +247,7 @@ def get_openapi_operation_metadata( |
|
|
|
if operation_id in operation_ids: |
|
|
|
message = ( |
|
|
|
f"Duplicate Operation ID {operation_id} for function " |
|
|
|
+ f"{route.endpoint.__name__}" # ty: ignore[unresolved-attribute] |
|
|
|
+ f"{route.endpoint.__name__}" # ty: ignore[unresolved-attribute] |
|
|
|
) |
|
|
|
file_name = getattr(route.endpoint, "__globals__", {}).get("__file__") |
|
|
|
if file_name: |
|
|
|
|