Home / Function/ is_pydantic_v1_model_class() — fastapi Function Reference

is_pydantic_v1_model_class() — fastapi Function Reference

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

Function python FastAPI Routing calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  64ba240e_8a87_8240_2e7f_69d6b5d97f5d["is_pydantic_v1_model_class()"]
  3e898b29_4dd8_c417_2d9b_a84d867423b4["shared.py"]
  64ba240e_8a87_8240_2e7f_69d6b5d97f5d -->|defined in| 3e898b29_4dd8_c417_2d9b_a84d867423b4
  e87b444f_22dd_b8d3_c540_e6cf7aa5c29e["annotation_is_pydantic_v1()"]
  e87b444f_22dd_b8d3_c540_e6cf7aa5c29e -->|calls| 64ba240e_8a87_8240_2e7f_69d6b5d97f5d
  eda91ac5_1bd0_0d8b_6e77_6b82c2f46ce9["lenient_issubclass()"]
  64ba240e_8a87_8240_2e7f_69d6b5d97f5d -->|calls| eda91ac5_1bd0_0d8b_6e77_6b82c2f46ce9
  style 64ba240e_8a87_8240_2e7f_69d6b5d97f5d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fastapi/_compat/shared.py lines 192–201

def is_pydantic_v1_model_class(cls: Any) -> bool:
    # TODO: remove this function once the required version of Pydantic fully
    # removes pydantic.v1
    try:
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", UserWarning)
            from pydantic import v1
    except ImportError:  # pragma: no cover
        return False
    return lenient_issubclass(cls, v1.BaseModel)

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free