Home / File/ params.py — fastapi Source File

params.py — fastapi Source File

Architecture documentation for params.py, a python file in the fastapi codebase. 13 imports, 8 dependents.

File python FastAPI Routing 13 imports 8 dependents 11 classes

Entity Profile

Dependency Diagram

graph LR
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e["params.py"]
  aac750d7_00e7_a28d_9e64_89918311078b["__init__.py"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> aac750d7_00e7_a28d_9e64_89918311078b
  9c2c9cad_dfd2_7d1a_1c6d_b8a448285db4["warnings"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 9c2c9cad_dfd2_7d1a_1c6d_b8a448285db4
  07d79a2e_d4e9_0bbb_be90_936274444c8c["collections.abc"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 07d79a2e_d4e9_0bbb_be90_936274444c8c
  4cff5a35_9399_b238_3d2b_e2cca82878e1["dataclasses"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 4cff5a35_9399_b238_3d2b_e2cca82878e1
  712b7268_fde0_3ca8_dc06_7aa9a47c77d9["enum"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 712b7268_fde0_3ca8_dc06_7aa9a47c77d9
  0dda2280_3359_8460_301c_e98c77e78185["typing"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 0dda2280_3359_8460_301c_e98c77e78185
  01c652c5_d85c_f45e_848e_412c94ea4172["exceptions.py"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 01c652c5_d85c_f45e_848e_412c94ea4172
  188b7cd0_ba07_6be7_094a_820e577cc47b["FastAPIDeprecationWarning"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 188b7cd0_ba07_6be7_094a_820e577cc47b
  7f688779_6b22_3c15_6514_97dec91c3c30["models.py"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 7f688779_6b22_3c15_6514_97dec91c3c30
  0b3bd71a_a167_b489_3767_f34b70b7ddda["Example"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 0b3bd71a_a167_b489_3767_f34b70b7ddda
  6913fbd4_39df_d14b_44bb_522e99b65b90["pydantic"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 6913fbd4_39df_d14b_44bb_522e99b65b90
  b736e30b_692b_1eb3_fc90_f9fee804449e["pydantic.fields"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> b736e30b_692b_1eb3_fc90_f9fee804449e
  87f0eda4_1c7f_c164_42ba_f715b8cf0a6b["typing_extensions"]
  2bb4dd2d_8b8a_6502_751c_38eabb6ae71e --> 87f0eda4_1c7f_c164_42ba_f715b8cf0a6b
  3e134d50_38c1_8523_f518_6686c1d9752b["v2.py"]
  3e134d50_38c1_8523_f518_6686c1d9752b --> 2bb4dd2d_8b8a_6502_751c_38eabb6ae71e
  style 2bb4dd2d_8b8a_6502_751c_38eabb6ae71e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import warnings
from collections.abc import Sequence
from dataclasses import dataclass
from enum import Enum
from typing import Annotated, Any, Callable, Optional, Union

from fastapi.exceptions import FastAPIDeprecationWarning
from fastapi.openapi.models import Example
from pydantic import AliasChoices, AliasPath
from pydantic.fields import FieldInfo
from typing_extensions import Literal, deprecated

from ._compat import (
    Undefined,
)

_Unset: Any = Undefined


class ParamTypes(Enum):
    query = "query"
    header = "header"
    path = "path"
    cookie = "cookie"


class Param(FieldInfo):  # type: ignore[misc]
    in_: ParamTypes

    def __init__(
        self,
        default: Any = Undefined,
        *,
        default_factory: Union[Callable[[], Any], None] = _Unset,
        annotation: Optional[Any] = None,
        alias: Optional[str] = None,
        alias_priority: Union[int, None] = _Unset,
        validation_alias: Union[str, AliasPath, AliasChoices, None] = None,
        serialization_alias: Union[str, None] = None,
        title: Optional[str] = None,
        description: Optional[str] = None,
        gt: Optional[float] = None,
        ge: Optional[float] = None,
        lt: Optional[float] = None,
        le: Optional[float] = None,
        min_length: Optional[int] = None,
        max_length: Optional[int] = None,
        pattern: Optional[str] = None,
        regex: Annotated[
            Optional[str],
            deprecated(
                "Deprecated in FastAPI 0.100.0 and Pydantic v2, use `pattern` instead."
            ),
        ] = None,
        discriminator: Union[str, None] = None,
        strict: Union[bool, None] = _Unset,
        multiple_of: Union[float, None] = _Unset,
        allow_inf_nan: Union[bool, None] = _Unset,
        max_digits: Union[int, None] = _Unset,
        decimal_places: Union[int, None] = _Unset,
// ... (696 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does params.py do?
params.py is a source file in the fastapi codebase, written in python. It belongs to the FastAPI domain, Routing subdomain.
What does params.py depend on?
params.py imports 13 module(s): Example, FastAPIDeprecationWarning, __init__.py, collections.abc, dataclasses, enum, exceptions.py, models.py, and 5 more.
What files import params.py?
params.py is imported by 8 file(s): applications.py, param_functions.py, routing.py, test_param_class.py, test_params_repr.py, utils.py, utils.py, v2.py.
Where is params.py in the architecture?
params.py is located at fastapi/params.py (domain: FastAPI, subdomain: Routing, directory: fastapi).

Analyze Your Own Codebase

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

Try Supermodel Free