|
|
|
@ -3,23 +3,21 @@ import email.message |
|
|
|
import functools |
|
|
|
import inspect |
|
|
|
import json |
|
|
|
from contextlib import AsyncExitStack, asynccontextmanager |
|
|
|
from enum import Enum, IntEnum |
|
|
|
from typing import ( |
|
|
|
Any, |
|
|
|
from collections.abc import ( |
|
|
|
AsyncIterator, |
|
|
|
Awaitable, |
|
|
|
Callable, |
|
|
|
Collection, |
|
|
|
Coroutine, |
|
|
|
Dict, |
|
|
|
List, |
|
|
|
Mapping, |
|
|
|
Optional, |
|
|
|
Sequence, |
|
|
|
Set, |
|
|
|
Tuple, |
|
|
|
Type, |
|
|
|
) |
|
|
|
from contextlib import AsyncExitStack, asynccontextmanager |
|
|
|
from enum import Enum, IntEnum |
|
|
|
from typing import ( |
|
|
|
Annotated, |
|
|
|
Any, |
|
|
|
Callable, |
|
|
|
Optional, |
|
|
|
Union, |
|
|
|
) |
|
|
|
|
|
|
|
@ -77,7 +75,7 @@ from starlette.routing import ( |
|
|
|
from starlette.routing import Mount as Mount # noqa |
|
|
|
from starlette.types import AppType, ASGIApp, Lifespan, Receive, Scope, Send |
|
|
|
from starlette.websockets import WebSocket |
|
|
|
from typing_extensions import Annotated, deprecated |
|
|
|
from typing_extensions import deprecated |
|
|
|
|
|
|
|
|
|
|
|
# Copy of starlette.routing.request_response modified to include the |
|
|
|
@ -214,7 +212,7 @@ def _merge_lifespan_context( |
|
|
|
|
|
|
|
|
|
|
|
# Cache for endpoint context to avoid re-extracting on every request |
|
|
|
_endpoint_context_cache: Dict[int, EndpointContext] = {} |
|
|
|
_endpoint_context_cache: dict[int, EndpointContext] = {} |
|
|
|
|
|
|
|
|
|
|
|
def _extract_endpoint_context(func: Any) -> EndpointContext: |
|
|
|
@ -306,7 +304,7 @@ async def serialize_response( |
|
|
|
|
|
|
|
|
|
|
|
async def run_endpoint_function( |
|
|
|
*, dependant: Dependant, values: Dict[str, Any], is_coroutine: bool |
|
|
|
*, dependant: Dependant, values: dict[str, Any], is_coroutine: bool |
|
|
|
) -> Any: |
|
|
|
# Only called by get_request_handler. Has been split into its own function to |
|
|
|
# facilitate profiling endpoints, since inner functions are harder to profile. |
|
|
|
@ -322,7 +320,7 @@ def get_request_handler( |
|
|
|
dependant: Dependant, |
|
|
|
body_field: Optional[ModelField] = None, |
|
|
|
status_code: Optional[int] = None, |
|
|
|
response_class: Union[Type[Response], DefaultPlaceholder] = Default(JSONResponse), |
|
|
|
response_class: Union[type[Response], DefaultPlaceholder] = Default(JSONResponse), |
|
|
|
response_field: Optional[ModelField] = None, |
|
|
|
response_model_include: Optional[IncEx] = None, |
|
|
|
response_model_exclude: Optional[IncEx] = None, |
|
|
|
@ -339,7 +337,7 @@ def get_request_handler( |
|
|
|
body_field.field_info, (params.Form, temp_pydantic_v1_params.Form) |
|
|
|
) |
|
|
|
if isinstance(response_class, DefaultPlaceholder): |
|
|
|
actual_response_class: Type[Response] = response_class.value |
|
|
|
actual_response_class: type[Response] = response_class.value |
|
|
|
else: |
|
|
|
actual_response_class = response_class |
|
|
|
|
|
|
|
@ -412,7 +410,7 @@ def get_request_handler( |
|
|
|
raise http_error from e |
|
|
|
|
|
|
|
# Solve dependencies and run path operation function, auto-closing dependencies |
|
|
|
errors: List[Any] = [] |
|
|
|
errors: list[Any] = [] |
|
|
|
async_exit_stack = request.scope.get("fastapi_inner_astack") |
|
|
|
assert isinstance(async_exit_stack, AsyncExitStack), ( |
|
|
|
"fastapi_inner_astack not found in request scope" |
|
|
|
@ -437,7 +435,7 @@ def get_request_handler( |
|
|
|
raw_response.background = solved_result.background_tasks |
|
|
|
response = raw_response |
|
|
|
else: |
|
|
|
response_args: Dict[str, Any] = { |
|
|
|
response_args: dict[str, Any] = { |
|
|
|
"background": solved_result.background_tasks |
|
|
|
} |
|
|
|
# If status_code was set, use it, otherwise use the default from the |
|
|
|
@ -550,7 +548,7 @@ class APIWebSocketRoute(routing.WebSocketRoute): |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
def matches(self, scope: Scope) -> Tuple[Match, Scope]: |
|
|
|
def matches(self, scope: Scope) -> tuple[Match, Scope]: |
|
|
|
match, child_scope = super().matches(scope) |
|
|
|
if match != Match.NONE: |
|
|
|
child_scope["route"] = self |
|
|
|
@ -565,15 +563,15 @@ class APIRoute(routing.Route): |
|
|
|
*, |
|
|
|
response_model: Any = Default(None), |
|
|
|
status_code: Optional[int] = None, |
|
|
|
tags: Optional[List[Union[str, Enum]]] = None, |
|
|
|
tags: Optional[list[Union[str, Enum]]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
responses: Optional[dict[Union[int, str], dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
methods: Optional[Union[Set[str], List[str]]] = None, |
|
|
|
methods: Optional[Union[set[str], list[str]]] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[IncEx] = None, |
|
|
|
response_model_exclude: Optional[IncEx] = None, |
|
|
|
@ -582,12 +580,12 @@ class APIRoute(routing.Route): |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Union[Type[Response], DefaultPlaceholder] = Default( |
|
|
|
response_class: Union[type[Response], DefaultPlaceholder] = Default( |
|
|
|
JSONResponse |
|
|
|
), |
|
|
|
dependency_overrides_provider: Optional[Any] = None, |
|
|
|
callbacks: Optional[List[BaseRoute]] = None, |
|
|
|
openapi_extra: Optional[Dict[str, Any]] = None, |
|
|
|
callbacks: Optional[list[BaseRoute]] = None, |
|
|
|
openapi_extra: Optional[dict[str, Any]] = None, |
|
|
|
generate_unique_id_function: Union[ |
|
|
|
Callable[["APIRoute"], str], DefaultPlaceholder |
|
|
|
] = Default(generate_unique_id), |
|
|
|
@ -623,7 +621,7 @@ class APIRoute(routing.Route): |
|
|
|
self.path_regex, self.path_format, self.param_convertors = compile_path(path) |
|
|
|
if methods is None: |
|
|
|
methods = ["GET"] |
|
|
|
self.methods: Set[str] = {method.upper() for method in methods} |
|
|
|
self.methods: set[str] = {method.upper() for method in methods} |
|
|
|
if isinstance(generate_unique_id_function, DefaultPlaceholder): |
|
|
|
current_generate_unique_id: Callable[[APIRoute], str] = ( |
|
|
|
generate_unique_id_function.value |
|
|
|
@ -678,7 +676,7 @@ class APIRoute(routing.Route): |
|
|
|
) |
|
|
|
response_fields[additional_status_code] = response_field |
|
|
|
if response_fields: |
|
|
|
self.response_fields: Dict[Union[int, str], ModelField] = response_fields |
|
|
|
self.response_fields: dict[Union[int, str], ModelField] = response_fields |
|
|
|
else: |
|
|
|
self.response_fields = {} |
|
|
|
|
|
|
|
@ -719,7 +717,7 @@ class APIRoute(routing.Route): |
|
|
|
embed_body_fields=self._embed_body_fields, |
|
|
|
) |
|
|
|
|
|
|
|
def matches(self, scope: Scope) -> Tuple[Match, Scope]: |
|
|
|
def matches(self, scope: Scope) -> tuple[Match, Scope]: |
|
|
|
match, child_scope = super().matches(scope) |
|
|
|
if match != Match.NONE: |
|
|
|
child_scope["route"] = self |
|
|
|
@ -758,7 +756,7 @@ class APIRouter(routing.Router): |
|
|
|
*, |
|
|
|
prefix: Annotated[str, Doc("An optional path prefix for the router.")] = "", |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to all the *path operations* in this |
|
|
|
@ -784,7 +782,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
default_response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
The default response class to be used. |
|
|
|
@ -795,7 +793,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = Default(JSONResponse), |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses to be shown in OpenAPI. |
|
|
|
@ -811,7 +809,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
OpenAPI callbacks that should apply to all *path operations* in this |
|
|
|
@ -825,7 +823,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
routes: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
**Note**: you probably shouldn't use this parameter, it is inherited |
|
|
|
@ -876,7 +874,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
route_class: Annotated[ |
|
|
|
Type[APIRoute], |
|
|
|
type[APIRoute], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Custom route (*path operation*) class to be used by this router. |
|
|
|
@ -982,7 +980,7 @@ class APIRouter(routing.Router): |
|
|
|
"A path prefix must not end with '/', as the routes will start with '/'" |
|
|
|
) |
|
|
|
self.prefix = prefix |
|
|
|
self.tags: List[Union[str, Enum]] = tags or [] |
|
|
|
self.tags: list[Union[str, Enum]] = tags or [] |
|
|
|
self.dependencies = list(dependencies or []) |
|
|
|
self.deprecated = deprecated |
|
|
|
self.include_in_schema = include_in_schema |
|
|
|
@ -1019,14 +1017,14 @@ class APIRouter(routing.Router): |
|
|
|
*, |
|
|
|
response_model: Any = Default(None), |
|
|
|
status_code: Optional[int] = None, |
|
|
|
tags: Optional[List[Union[str, Enum]]] = None, |
|
|
|
tags: Optional[list[Union[str, Enum]]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
responses: Optional[dict[Union[int, str], dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
methods: Optional[Union[Set[str], List[str]]] = None, |
|
|
|
methods: Optional[Union[set[str], list[str]]] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[IncEx] = None, |
|
|
|
response_model_exclude: Optional[IncEx] = None, |
|
|
|
@ -1035,13 +1033,13 @@ class APIRouter(routing.Router): |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Union[Type[Response], DefaultPlaceholder] = Default( |
|
|
|
response_class: Union[type[Response], DefaultPlaceholder] = Default( |
|
|
|
JSONResponse |
|
|
|
), |
|
|
|
name: Optional[str] = None, |
|
|
|
route_class_override: Optional[Type[APIRoute]] = None, |
|
|
|
callbacks: Optional[List[BaseRoute]] = None, |
|
|
|
openapi_extra: Optional[Dict[str, Any]] = None, |
|
|
|
route_class_override: Optional[type[APIRoute]] = None, |
|
|
|
callbacks: Optional[list[BaseRoute]] = None, |
|
|
|
openapi_extra: Optional[dict[str, Any]] = None, |
|
|
|
generate_unique_id_function: Union[ |
|
|
|
Callable[[APIRoute], str], DefaultPlaceholder |
|
|
|
] = Default(generate_unique_id), |
|
|
|
@ -1100,14 +1098,14 @@ class APIRouter(routing.Router): |
|
|
|
*, |
|
|
|
response_model: Any = Default(None), |
|
|
|
status_code: Optional[int] = None, |
|
|
|
tags: Optional[List[Union[str, Enum]]] = None, |
|
|
|
tags: Optional[list[Union[str, Enum]]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
responses: Optional[dict[Union[int, str], dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
methods: Optional[List[str]] = None, |
|
|
|
methods: Optional[list[str]] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[IncEx] = None, |
|
|
|
response_model_exclude: Optional[IncEx] = None, |
|
|
|
@ -1116,10 +1114,10 @@ class APIRouter(routing.Router): |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = Default(JSONResponse), |
|
|
|
response_class: type[Response] = Default(JSONResponse), |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[BaseRoute]] = None, |
|
|
|
openapi_extra: Optional[Dict[str, Any]] = None, |
|
|
|
callbacks: Optional[list[BaseRoute]] = None, |
|
|
|
openapi_extra: Optional[dict[str, Any]] = None, |
|
|
|
generate_unique_id_function: Callable[[APIRoute], str] = Default( |
|
|
|
generate_unique_id |
|
|
|
), |
|
|
|
@ -1259,7 +1257,7 @@ class APIRouter(routing.Router): |
|
|
|
*, |
|
|
|
prefix: Annotated[str, Doc("An optional path prefix for the router.")] = "", |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to all the *path operations* in this |
|
|
|
@ -1285,7 +1283,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
default_response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
The default response class to be used. |
|
|
|
@ -1296,7 +1294,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = Default(JSONResponse), |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses to be shown in OpenAPI. |
|
|
|
@ -1312,7 +1310,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
OpenAPI callbacks that should apply to all *path operations* in this |
|
|
|
@ -1417,7 +1415,7 @@ class APIRouter(routing.Router): |
|
|
|
current_tags.extend(tags) |
|
|
|
if route.tags: |
|
|
|
current_tags.extend(route.tags) |
|
|
|
current_dependencies: List[params.Depends] = [] |
|
|
|
current_dependencies: list[params.Depends] = [] |
|
|
|
if dependencies: |
|
|
|
current_dependencies.extend(dependencies) |
|
|
|
if route.dependencies: |
|
|
|
@ -1558,7 +1556,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -1624,7 +1622,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -1765,7 +1763,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -1786,7 +1784,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -1802,7 +1800,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -1935,7 +1933,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -2001,7 +1999,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -2142,7 +2140,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -2163,7 +2161,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -2179,7 +2177,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -2317,7 +2315,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -2383,7 +2381,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -2524,7 +2522,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -2545,7 +2543,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -2561,7 +2559,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -2699,7 +2697,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -2765,7 +2763,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -2906,7 +2904,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -2927,7 +2925,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -2943,7 +2941,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -3076,7 +3074,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -3142,7 +3140,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -3283,7 +3281,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -3304,7 +3302,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -3320,7 +3318,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -3453,7 +3451,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -3519,7 +3517,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -3660,7 +3658,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -3681,7 +3679,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -3697,7 +3695,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -3835,7 +3833,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -3901,7 +3899,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -4042,7 +4040,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -4063,7 +4061,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -4079,7 +4077,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
@ -4217,7 +4215,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
tags: Annotated[ |
|
|
|
Optional[List[Union[str, Enum]]], |
|
|
|
Optional[list[Union[str, Enum]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
A list of tags to be applied to the *path operation*. |
|
|
|
@ -4283,7 +4281,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = "Successful Response", |
|
|
|
responses: Annotated[ |
|
|
|
Optional[Dict[Union[int, str], Dict[str, Any]]], |
|
|
|
Optional[dict[Union[int, str], dict[str, Any]]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Additional responses that could be returned by this *path operation*. |
|
|
|
@ -4424,7 +4422,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = True, |
|
|
|
response_class: Annotated[ |
|
|
|
Type[Response], |
|
|
|
type[Response], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Response class to be used for this *path operation*. |
|
|
|
@ -4445,7 +4443,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
callbacks: Annotated[ |
|
|
|
Optional[List[BaseRoute]], |
|
|
|
Optional[list[BaseRoute]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
List of *path operations* that will be used as OpenAPI callbacks. |
|
|
|
@ -4461,7 +4459,7 @@ class APIRouter(routing.Router): |
|
|
|
), |
|
|
|
] = None, |
|
|
|
openapi_extra: Annotated[ |
|
|
|
Optional[Dict[str, Any]], |
|
|
|
Optional[dict[str, Any]], |
|
|
|
Doc( |
|
|
|
""" |
|
|
|
Extra metadata to be included in the OpenAPI schema for this *path |
|
|
|
|