Replace ReDoc docs with Scalar UI

This commit is contained in:
Egor
2025-09-28 04:27:43 +03:00
parent e3e6428d2a
commit 870ee2fb66
3 changed files with 4 additions and 4 deletions

View File

@@ -980,11 +980,11 @@ class Settings(BaseSettings):
if self.WEB_API_DOCS_ENABLED:
return {
"docs_url": "/docs",
"redoc_url": "/redoc",
"scalar_url": "/scalar",
"openapi_url": "/openapi.json",
}
return {"docs_url": None, "redoc_url": None, "openapi_url": None}
return {"docs_url": None, "scalar_url": None, "openapi_url": None}
def get_support_system_mode(self) -> str:
mode = (self.SUPPORT_SYSTEM_MODE or "both").strip().lower()

View File

@@ -26,7 +26,7 @@ def create_web_api_app() -> FastAPI:
title=settings.WEB_API_TITLE,
version=settings.WEB_API_VERSION,
docs_url=docs_config.get("docs_url"),
redoc_url=docs_config.get("redoc_url"),
scalar_url=docs_config.get("scalar_url"),
openapi_url=docs_config.get("openapi_url"),
swagger_ui_parameters={"persistAuthorization": True},
)

View File

@@ -34,7 +34,7 @@ API разворачивается вместе с ботом, использу
Чтобы открыть интерфейс Swagger UI на `/docs`, убедитесь, что одновременно заданы две переменные окружения:
1. `WEB_API_ENABLED=true` — включает само веб-API.
2. `WEB_API_DOCS_ENABLED=true` — публикует `/docs`, `/redoc` и `/openapi.json`.
2. `WEB_API_DOCS_ENABLED=true` — публикует `/docs`, `/scalar` и `/openapi.json`.
После изменения значений перезапустите бота. Интерфейс будет доступен по адресу `http://<WEB_API_HOST>:<WEB_API_PORT>/docs`.