johnslavik
7 months ago
Failed to extract signature
1 changed files with
2 additions and
1 deletions
-
fastapi/routing.py
|
|
|
@ -29,6 +29,7 @@ from fastapi._compat import ( |
|
|
|
_model_dump, |
|
|
|
_normalize_errors, |
|
|
|
lenient_issubclass, |
|
|
|
may_v1, |
|
|
|
) |
|
|
|
from fastapi.datastructures import Default, DefaultPlaceholder |
|
|
|
from fastapi.dependencies.models import Dependant |
|
|
|
@ -152,7 +153,7 @@ def _prepare_response_content( |
|
|
|
exclude_defaults: bool = False, |
|
|
|
exclude_none: bool = False, |
|
|
|
) -> Any: |
|
|
|
if isinstance(res, BaseModel): |
|
|
|
if isinstance(res, (may_v1.BaseModel, BaseModel)): |
|
|
|
read_with_orm_mode = getattr(_get_model_config(res), "read_with_orm_mode", None) |
|
|
|
if read_with_orm_mode: |
|
|
|
# Let from_orm extract the data from this model instead of converting |
|
|
|
|