pre-commit-ci-lite[bot]
5 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
0 deletions
-
fastapi/encoders.py
|
|
@ -241,6 +241,7 @@ def jsonable_encoder( |
|
|
if exclude is not None and not isinstance(exclude, (set, dict)): |
|
|
if exclude is not None and not isinstance(exclude, (set, dict)): |
|
|
exclude = set(exclude) # type: ignore[assignment] # ty: ignore[invalid-assignment] |
|
|
exclude = set(exclude) # type: ignore[assignment] # ty: ignore[invalid-assignment] |
|
|
if isinstance(obj, BaseModel): |
|
|
if isinstance(obj, BaseModel): |
|
|
|
|
|
|
|
|
def custom_encoder_fallback(value: Any) -> Any: |
|
|
def custom_encoder_fallback(value: Any) -> Any: |
|
|
if type(value) in custom_encoder: |
|
|
if type(value) in custom_encoder: |
|
|
encoded_value = custom_encoder[type(value)](value) |
|
|
encoded_value = custom_encoder[type(value)](value) |
|
|
|