(req: Request)
| 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 |
nothing calls this directly
no test coverage detected