pre-commit-ci-lite[bot]
8 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
6 deletions
-
fastapi/routing.py
|
|
@ -545,12 +545,9 @@ class APIRoute(routing.Route): |
|
|
response_model = None |
|
|
response_model = None |
|
|
else: |
|
|
else: |
|
|
response_model = return_annotation |
|
|
response_model = return_annotation |
|
|
if ( |
|
|
if response_model is None or ( |
|
|
response_model is None |
|
|
not lenient_issubclass(response_model, BaseModel) |
|
|
or ( |
|
|
and not dataclasses.is_dataclass(response_model) |
|
|
not lenient_issubclass(response_model, BaseModel) |
|
|
|
|
|
and not dataclasses.is_dataclass(response_model) |
|
|
|
|
|
) |
|
|
|
|
|
): |
|
|
): |
|
|
inferred = infer_response_model_from_ast(endpoint) |
|
|
inferred = infer_response_model_from_ast(endpoint) |
|
|
if inferred: |
|
|
if inferred: |
|
|
|