Home / Function/ field_annotation_is_sequence() — fastapi Function Reference

field_annotation_is_sequence() — fastapi Function Reference

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

Function python FastAPI Responses calls 1 called by 4

Entity Profile

Dependency Diagram

graph TD
  8270df11_9596_bb04_cf3e_ab064ec2d09a["field_annotation_is_sequence()"]
  3e898b29_4dd8_c417_2d9b_a84d867423b4["shared.py"]
  8270df11_9596_bb04_cf3e_ab064ec2d09a -->|defined in| 3e898b29_4dd8_c417_2d9b_a84d867423b4
  4dfe14d4_f887_9fbf_e35f_b0033e4779c0["field_annotation_is_scalar_sequence()"]
  4dfe14d4_f887_9fbf_e35f_b0033e4779c0 -->|calls| 8270df11_9596_bb04_cf3e_ab064ec2d09a
  7902a3e7_b475_cc3f_95dd_6266d428706b["is_bytes_sequence_annotation()"]
  7902a3e7_b475_cc3f_95dd_6266d428706b -->|calls| 8270df11_9596_bb04_cf3e_ab064ec2d09a
  0dc3f135_78b9_7c51_1a27_130a2c8730e3["is_uploadfile_sequence_annotation()"]
  0dc3f135_78b9_7c51_1a27_130a2c8730e3 -->|calls| 8270df11_9596_bb04_cf3e_ab064ec2d09a
  e87b444f_22dd_b8d3_c540_e6cf7aa5c29e["annotation_is_pydantic_v1()"]
  e87b444f_22dd_b8d3_c540_e6cf7aa5c29e -->|calls| 8270df11_9596_bb04_cf3e_ab064ec2d09a
  42e192a3_9947_71f3_357b_4a6d32fd71a1["_annotation_is_sequence()"]
  8270df11_9596_bb04_cf3e_ab064ec2d09a -->|calls| 42e192a3_9947_71f3_357b_4a6d32fd71a1
  style 8270df11_9596_bb04_cf3e_ab064ec2d09a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/_compat/shared.py lines 66–75

def field_annotation_is_sequence(annotation: Union[type[Any], None]) -> bool:
    origin = get_origin(annotation)
    if origin is Union or origin is UnionType:
        for arg in get_args(annotation):
            if field_annotation_is_sequence(arg):
                return True
        return False
    return _annotation_is_sequence(annotation) or _annotation_is_sequence(
        get_origin(annotation)
    )

Domain

Subdomains

Frequently Asked Questions

What does field_annotation_is_sequence() do?
field_annotation_is_sequence() is a function in the fastapi codebase, defined in fastapi/_compat/shared.py.
Where is field_annotation_is_sequence() defined?
field_annotation_is_sequence() is defined in fastapi/_compat/shared.py at line 66.
What does field_annotation_is_sequence() call?
field_annotation_is_sequence() calls 1 function(s): _annotation_is_sequence.
What calls field_annotation_is_sequence()?
field_annotation_is_sequence() is called by 4 function(s): annotation_is_pydantic_v1, field_annotation_is_scalar_sequence, is_bytes_sequence_annotation, is_uploadfile_sequence_annotation.

Analyze Your Own Codebase

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

Try Supermodel Free