Home / Function/ is_uploadfile_or_nonable_uploadfile_annotation() — fastapi Function Reference

is_uploadfile_or_nonable_uploadfile_annotation() — fastapi Function Reference

Architecture documentation for the is_uploadfile_or_nonable_uploadfile_annotation() function in shared.py from the fastapi codebase.

Function python FastAPI Applications calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  245eea39_2ef6_5396_6a25_33a04a249c5c["is_uploadfile_or_nonable_uploadfile_annotation()"]
  3e898b29_4dd8_c417_2d9b_a84d867423b4["shared.py"]
  245eea39_2ef6_5396_6a25_33a04a249c5c -->|defined in| 3e898b29_4dd8_c417_2d9b_a84d867423b4
  0dc3f135_78b9_7c51_1a27_130a2c8730e3["is_uploadfile_sequence_annotation()"]
  0dc3f135_78b9_7c51_1a27_130a2c8730e3 -->|calls| 245eea39_2ef6_5396_6a25_33a04a249c5c
  eda91ac5_1bd0_0d8b_6e77_6b82c2f46ce9["lenient_issubclass()"]
  245eea39_2ef6_5396_6a25_33a04a249c5c -->|calls| eda91ac5_1bd0_0d8b_6e77_6b82c2f46ce9
  style 245eea39_2ef6_5396_6a25_33a04a249c5c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/_compat/shared.py lines 139–147

def is_uploadfile_or_nonable_uploadfile_annotation(annotation: Any) -> bool:
    if lenient_issubclass(annotation, UploadFile):
        return True
    origin = get_origin(annotation)
    if origin is Union or origin is UnionType:
        for arg in get_args(annotation):
            if lenient_issubclass(arg, UploadFile):
                return True
    return False

Domain

Subdomains

Frequently Asked Questions

What does is_uploadfile_or_nonable_uploadfile_annotation() do?
is_uploadfile_or_nonable_uploadfile_annotation() is a function in the fastapi codebase, defined in fastapi/_compat/shared.py.
Where is is_uploadfile_or_nonable_uploadfile_annotation() defined?
is_uploadfile_or_nonable_uploadfile_annotation() is defined in fastapi/_compat/shared.py at line 139.
What does is_uploadfile_or_nonable_uploadfile_annotation() call?
is_uploadfile_or_nonable_uploadfile_annotation() calls 1 function(s): lenient_issubclass.
What calls is_uploadfile_or_nonable_uploadfile_annotation()?
is_uploadfile_or_nonable_uploadfile_annotation() is called by 1 function(s): is_uploadfile_sequence_annotation.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free