MCPcopy
hub / github.com/fastapi/fastapi / swagger_ui_html

Method swagger_ui_html

fastapi/applications.py:1123–1135  ·  view source on GitHub ↗
(req: Request)

Source from the content-addressed store, hash-verified

1121 if self.openapi_url and self.docs_url:
1122
1123 async def swagger_ui_html(req: Request) -> HTMLResponse:
1124 root_path = req.scope.get("root_path", "").rstrip("/")
1125 openapi_url = root_path + self.openapi_url
1126 oauth2_redirect_url = self.swagger_ui_oauth2_redirect_url
1127 if oauth2_redirect_url:
1128 oauth2_redirect_url = root_path + oauth2_redirect_url
1129 return get_swagger_ui_html(
1130 openapi_url=openapi_url,
1131 title=f"{self.title} - Swagger UI",
1132 oauth2_redirect_url=oauth2_redirect_url,
1133 init_oauth=self.swagger_ui_init_oauth,
1134 swagger_ui_parameters=self.swagger_ui_parameters,
1135 )
1136
1137 self.add_route(self.docs_url, swagger_ui_html, include_in_schema=False)
1138

Callers

nothing calls this directly

Calls 2

get_swagger_ui_htmlFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected