Open SolardiaX opened 1 year ago
I've got the same behavior. Here's my classes:
from odmantic import Field, Model
class CoreModel(Model):
created_at: int = Field(
default_factory=lambda: int(time.time()),
description="Unix timestamp when the user was created",
)
updated_at: int = Field(
default_factory=lambda: int(time.time()),
description="Unix timestamp of the last update",
)
class User(CoreModel):
first_name: str
last_name: str
@SolardiaX any fixes/workaround?
Bug
Current Behavior
The response model in FastAPI swagger for CurrentUser only has the
token
field,username
andpassword
in parent class is missing.Expected behavior
The response model in FastAPI swagger for CurrentUser should contains
username
,password
andtoken
.Environment
python -c "import pydantic.utils; print(pydantic.utils.version_info())
):pydantic version: 1.10.9 pydantic compiled: True install path: ... python version: 3.11.3 (main, Apr 7 2023, 20:13:31) [Clang 14.0.0 (clang-1400.0.29.202)] platform: macOS-13.4-arm64-arm-64bit optional deps. installed: ['typing-extensions']
Additional context