From c6d28c8209bed6bd4a3914d3cb38a655a60521ab Mon Sep 17 00:00:00 2001 From: Mohammed Date: Fri, 22 Mar 2019 22:50:47 +0300 Subject: [PATCH] Accept Multiple Additional Responses --- fastapi/applications.py | 22 +++++++++++----------- fastapi/routing.py | 24 ++++++++++++------------ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index 7c29141ec..5ead7db91 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -115,7 +115,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, methods: List[str] = None, operation_id: str = None, @@ -151,7 +151,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, methods: List[str] = None, operation_id: str = None, @@ -187,7 +187,7 @@ class FastAPI(Starlette): *, prefix: str = "", tags: List[str] = None, - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], ) -> None: self.router.include_router(router, prefix=prefix, tags=tags, additional_responses=additional_responses,) @@ -201,7 +201,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -234,7 +234,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -267,7 +267,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -300,7 +300,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -333,7 +333,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -366,7 +366,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -399,7 +399,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -432,7 +432,7 @@ class FastAPI(Starlette): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, diff --git a/fastapi/routing.py b/fastapi/routing.py index b59d1eb95..57bbe7a63 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -105,7 +105,7 @@ class APIRoute(routing.Route): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, name: str = None, methods: List[str] = None, @@ -226,7 +226,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, methods: List[str] = None, operation_id: str = None, @@ -263,7 +263,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, methods: List[str] = None, operation_id: str = None, @@ -299,7 +299,7 @@ class APIRouter(routing.Router): *, prefix: str = "", tags: List[str] = None, - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], ) -> None: if prefix: assert prefix.startswith("/"), "A path prefix must start with '/'" @@ -391,7 +391,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -425,7 +425,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -459,7 +459,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -493,7 +493,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -527,7 +527,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -561,7 +561,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -595,7 +595,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True, @@ -629,7 +629,7 @@ class APIRouter(routing.Router): summary: str = None, description: str = None, response_description: str = "Successful Response", - additional_responses: AdditionalResponse = [], + additional_responses: List[AdditionalResponse] = [], deprecated: bool = None, operation_id: str = None, include_in_schema: bool = True,