|
|
@ -93,9 +93,9 @@ def _prepare_response_content( |
|
|
|
|
|
|
|
async def serialize_response( |
|
|
|
*, |
|
|
|
field: ModelField = None, |
|
|
|
field: Optional[ModelField] = None, |
|
|
|
response_content: Any, |
|
|
|
include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
by_alias: bool = True, |
|
|
|
exclude_unset: bool = False, |
|
|
@ -151,17 +151,17 @@ async def run_endpoint_function( |
|
|
|
|
|
|
|
def get_request_handler( |
|
|
|
dependant: Dependant, |
|
|
|
body_field: ModelField = None, |
|
|
|
body_field: Optional[ModelField] = None, |
|
|
|
status_code: int = 200, |
|
|
|
response_class: Type[Response] = JSONResponse, |
|
|
|
response_field: ModelField = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
response_field: Optional[ModelField] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
dependency_overrides_provider: Any = None, |
|
|
|
dependency_overrides_provider: Optional[Any] = None, |
|
|
|
) -> Callable: |
|
|
|
assert dependant.call is not None, "dependant.call must be a function" |
|
|
|
is_coroutine = asyncio.iscoroutinefunction(dependant.call) |
|
|
@ -226,7 +226,7 @@ def get_request_handler( |
|
|
|
|
|
|
|
|
|
|
|
def get_websocket_app( |
|
|
|
dependant: Dependant, dependency_overrides_provider: Any = None |
|
|
|
dependant: Dependant, dependency_overrides_provider: Optional[Any] = None |
|
|
|
) -> Callable: |
|
|
|
async def app(websocket: WebSocket) -> None: |
|
|
|
solved_result = await solve_dependencies( |
|
|
@ -250,8 +250,8 @@ class APIWebSocketRoute(routing.WebSocketRoute): |
|
|
|
path: str, |
|
|
|
endpoint: Callable, |
|
|
|
*, |
|
|
|
name: str = None, |
|
|
|
dependency_overrides_provider: Any = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
dependency_overrides_provider: Optional[Any] = None, |
|
|
|
) -> None: |
|
|
|
self.path = path |
|
|
|
self.endpoint = endpoint |
|
|
@ -272,19 +272,19 @@ class APIRoute(routing.Route): |
|
|
|
path: str, |
|
|
|
endpoint: Callable, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
name: str = 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, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
@ -292,7 +292,7 @@ class APIRoute(routing.Route): |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
dependency_overrides_provider: Any = None, |
|
|
|
dependency_overrides_provider: Optional[Any] = None, |
|
|
|
callbacks: Optional[List["APIRoute"]] = None, |
|
|
|
) -> None: |
|
|
|
# normalise enums e.g. http.HTTPStatus |
|
|
@ -401,14 +401,14 @@ class APIRoute(routing.Route): |
|
|
|
class APIRouter(routing.Router): |
|
|
|
def __init__( |
|
|
|
self, |
|
|
|
routes: List[routing.BaseRoute] = None, |
|
|
|
routes: Optional[List[routing.BaseRoute]] = None, |
|
|
|
redirect_slashes: bool = True, |
|
|
|
default: ASGIApp = None, |
|
|
|
dependency_overrides_provider: Any = None, |
|
|
|
default: Optional[ASGIApp] = None, |
|
|
|
dependency_overrides_provider: Optional[Any] = None, |
|
|
|
route_class: Type[APIRoute] = APIRoute, |
|
|
|
default_response_class: Type[Response] = None, |
|
|
|
on_startup: Sequence[Callable] = None, |
|
|
|
on_shutdown: Sequence[Callable] = None, |
|
|
|
default_response_class: Optional[Type[Response]] = None, |
|
|
|
on_startup: Optional[Sequence[Callable]] = None, |
|
|
|
on_shutdown: Optional[Sequence[Callable]] = None, |
|
|
|
) -> None: |
|
|
|
super().__init__( |
|
|
|
routes=routes, |
|
|
@ -426,29 +426,29 @@ class APIRouter(routing.Router): |
|
|
|
path: str, |
|
|
|
endpoint: Callable, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
methods: Optional[Union[Set[str], List[str]]] = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
route_class_override: Optional[Type[APIRoute]] = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> None: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -487,28 +487,28 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
methods: List[str] = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
methods: Optional[List[str]] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -546,7 +546,7 @@ class APIRouter(routing.Router): |
|
|
|
return decorator |
|
|
|
|
|
|
|
def add_api_websocket_route( |
|
|
|
self, path: str, endpoint: Callable, name: str = None |
|
|
|
self, path: str, endpoint: Callable, name: Optional[str] = None |
|
|
|
) -> None: |
|
|
|
route = APIWebSocketRoute( |
|
|
|
path, |
|
|
@ -556,7 +556,7 @@ class APIRouter(routing.Router): |
|
|
|
) |
|
|
|
self.routes.append(route) |
|
|
|
|
|
|
|
def websocket(self, path: str, name: str = None) -> Callable: |
|
|
|
def websocket(self, path: str, name: Optional[str] = None) -> Callable: |
|
|
|
def decorator(func: Callable) -> Callable: |
|
|
|
self.add_api_websocket_route(path, func, name=name) |
|
|
|
return func |
|
|
@ -568,9 +568,9 @@ class APIRouter(routing.Router): |
|
|
|
router: "APIRouter", |
|
|
|
*, |
|
|
|
prefix: str = "", |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
default_response_class: Optional[Type[Response]] = None, |
|
|
|
) -> None: |
|
|
|
if prefix: |
|
|
@ -643,27 +643,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -698,27 +698,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -753,27 +753,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -808,27 +808,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -863,27 +863,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -918,27 +918,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -973,27 +973,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
@ -1028,27 +1028,27 @@ class APIRouter(routing.Router): |
|
|
|
self, |
|
|
|
path: str, |
|
|
|
*, |
|
|
|
response_model: Type[Any] = None, |
|
|
|
response_model: Optional[Type[Any]] = None, |
|
|
|
status_code: int = 200, |
|
|
|
tags: List[str] = None, |
|
|
|
dependencies: Sequence[params.Depends] = None, |
|
|
|
summary: str = None, |
|
|
|
description: str = None, |
|
|
|
tags: Optional[List[str]] = None, |
|
|
|
dependencies: Optional[Sequence[params.Depends]] = None, |
|
|
|
summary: Optional[str] = None, |
|
|
|
description: Optional[str] = None, |
|
|
|
response_description: str = "Successful Response", |
|
|
|
responses: Dict[Union[int, str], Dict[str, Any]] = None, |
|
|
|
deprecated: bool = None, |
|
|
|
operation_id: str = None, |
|
|
|
response_model_include: Union[SetIntStr, DictIntStrAny] = None, |
|
|
|
responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None, |
|
|
|
deprecated: Optional[bool] = None, |
|
|
|
operation_id: Optional[str] = None, |
|
|
|
response_model_include: Optional[Union[SetIntStr, DictIntStrAny]] = None, |
|
|
|
response_model_exclude: Union[SetIntStr, DictIntStrAny] = set(), |
|
|
|
response_model_by_alias: bool = True, |
|
|
|
response_model_skip_defaults: bool = None, |
|
|
|
response_model_skip_defaults: Optional[bool] = None, |
|
|
|
response_model_exclude_unset: bool = False, |
|
|
|
response_model_exclude_defaults: bool = False, |
|
|
|
response_model_exclude_none: bool = False, |
|
|
|
include_in_schema: bool = True, |
|
|
|
response_class: Type[Response] = None, |
|
|
|
name: str = None, |
|
|
|
callbacks: List[APIRoute] = None, |
|
|
|
response_class: Optional[Type[Response]] = None, |
|
|
|
name: Optional[str] = None, |
|
|
|
callbacks: Optional[List[APIRoute]] = None, |
|
|
|
) -> Callable: |
|
|
|
if response_model_skip_defaults is not None: |
|
|
|
warning_response_model_skip_defaults_deprecated() # pragma: nocover |
|
|
|