mirror of https://github.com/tiangolo/fastapi.git
Merge 60e2d16f07 into 31bbb38074
This commit is contained in:
commit
906348df24
|
|
@ -859,6 +859,17 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = True,
|
] = True,
|
||||||
|
router_class: Annotated[
|
||||||
|
Type[routing.APIRouter],
|
||||||
|
Doc(
|
||||||
|
"""
|
||||||
|
The default router class to be used.
|
||||||
|
|
||||||
|
Read more in the
|
||||||
|
[FastAPI docs for Custom Router](Bigger Applications - Multiple Files).
|
||||||
|
"""
|
||||||
|
),
|
||||||
|
] = routing.APIRouter,
|
||||||
**extra: Annotated[
|
**extra: Annotated[
|
||||||
Any,
|
Any,
|
||||||
Doc(
|
Doc(
|
||||||
|
|
@ -943,7 +954,7 @@ class FastAPI(Starlette):
|
||||||
[FastAPI docs for OpenAPI Webhooks](https://fastapi.tiangolo.com/advanced/openapi-webhooks/).
|
[FastAPI docs for OpenAPI Webhooks](https://fastapi.tiangolo.com/advanced/openapi-webhooks/).
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = webhooks or routing.APIRouter()
|
] = webhooks or router_class()
|
||||||
self.root_path = root_path or openapi_prefix
|
self.root_path = root_path or openapi_prefix
|
||||||
self.state: Annotated[
|
self.state: Annotated[
|
||||||
State,
|
State,
|
||||||
|
|
@ -979,7 +990,7 @@ class FastAPI(Starlette):
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
] = {}
|
] = {}
|
||||||
self.router: routing.APIRouter = routing.APIRouter(
|
self.router: routing.APIRouter = router_class(
|
||||||
routes=routes,
|
routes=routes,
|
||||||
redirect_slashes=redirect_slashes,
|
redirect_slashes=redirect_slashes,
|
||||||
dependency_overrides_provider=self,
|
dependency_overrides_provider=self,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue