Browse Source

Accept Multiple Additional Responses

pull/97/head
Mohammed 6 years ago
parent
commit
c6d28c8209
  1. 22
      fastapi/applications.py
  2. 24
      fastapi/routing.py

22
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,

24
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,

Loading…
Cancel
Save