__init__() — fastapi Function Reference
Architecture documentation for the __init__() function in api_key.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD f0875812_eebe_7a79_1faf_6af811129326["__init__()"] 2c7ee275_5b1d_2ff3_f026_73e1cfeec40b["APIKeyQuery"] f0875812_eebe_7a79_1faf_6af811129326 -->|defined in| 2c7ee275_5b1d_2ff3_f026_73e1cfeec40b style f0875812_eebe_7a79_1faf_6af811129326 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
fastapi/security/api_key.py lines 85–138
def __init__(
self,
*,
name: Annotated[
str,
Doc("Query parameter name."),
],
scheme_name: Annotated[
Optional[str],
Doc(
"""
Security scheme name.
It will be included in the generated OpenAPI (e.g. visible at `/docs`).
"""
),
] = None,
description: Annotated[
Optional[str],
Doc(
"""
Security scheme description.
It will be included in the generated OpenAPI (e.g. visible at `/docs`).
"""
),
] = None,
auto_error: Annotated[
bool,
Doc(
"""
By default, if the query parameter is not provided, `APIKeyQuery` will
automatically cancel the request and send the client an error.
If `auto_error` is set to `False`, when the query parameter is not
available, instead of erroring out, the dependency result will be
`None`.
This is useful when you want to have optional authentication.
It is also useful when you want to have authentication that can be
provided in one of multiple optional ways (for example, in a query
parameter or in an HTTP Bearer token).
"""
),
] = True,
):
super().__init__(
location=APIKeyIn.query,
name=name,
scheme_name=scheme_name,
description=description,
auto_error=auto_error,
)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does __init__() do?
__init__() is a function in the fastapi codebase, defined in fastapi/security/api_key.py.
Where is __init__() defined?
__init__() is defined in fastapi/security/api_key.py at line 85.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free