Browse Source

Fix comments and type hints in models.py

pull/15121/head
Shukurullo Mamadaliyev 4 months ago
committed by GitHub
parent
commit
5371a4fc49
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      fastapi/openapi/models.py

8
fastapi/openapi/models.py

@ -16,11 +16,11 @@ from typing_extensions import deprecated as typing_deprecated
try: try:
import email_validator import email_validator
assert email_validator # make autoflake ignore the unused import assert email_validator # Make autoflake ignore the unused import
from pydantic import EmailStr from pydantic import EmailStr
except ImportError: # pragma: no cover except ImportError: # Pragma: no cover
class EmailStr(str): # type: ignore class EmailStr(str): # Type: ignore
@classmethod @classmethod
def __get_validators__(cls) -> Iterable[Callable[..., Any]]: def __get_validators__(cls) -> Iterable[Callable[..., Any]]:
yield cls.validate yield cls.validate
@ -215,7 +215,7 @@ class Example(TypedDict, total=False):
value: Any | None value: Any | None
externalValue: AnyUrl | None externalValue: AnyUrl | None
__pydantic_config__ = {"extra": "allow"} # type: ignore[misc] __pydantic_config__ = {"extra": "allow"} # Type: ignore[misc]
class ParameterInType(Enum): class ParameterInType(Enum):

Loading…
Cancel
Save