mirror of
https://github.com/fastapi/fastapi.git
synced 2026-09-14 13:36:21 +08:00
🐛 Replace MultHostUrl to AnyUrl for compatibility with older versions of Pydantic v1 (#9852)
This commit is contained in:
committed by
GitHub
parent
f7e3559bd5
commit
6c99e90a6b
+3
-3
@@ -20,10 +20,10 @@ from uuid import UUID
|
||||
from fastapi.types import IncEx
|
||||
from pydantic import BaseModel
|
||||
from pydantic.color import Color
|
||||
from pydantic.networks import NameEmail
|
||||
from pydantic.networks import AnyUrl, NameEmail
|
||||
from pydantic.types import SecretBytes, SecretStr
|
||||
|
||||
from ._compat import PYDANTIC_V2, MultiHostUrl, Url, _model_dump
|
||||
from ._compat import PYDANTIC_V2, Url, _model_dump
|
||||
|
||||
|
||||
# Taken from Pydantic v1 as is
|
||||
@@ -80,7 +80,7 @@ ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
|
||||
set: list,
|
||||
UUID: str,
|
||||
Url: str,
|
||||
MultiHostUrl: str,
|
||||
AnyUrl: str,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user