From e2f0ff8ffdfc7af8d7bc0820038fd13d0d0e2812 Mon Sep 17 00:00:00 2001 From: MrPandir Date: Sat, 17 Feb 2024 21:54:43 +0100 Subject: [PATCH] chore: replace root schema path with swagger --- app/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/app.py b/app/app.py index a124e26..f2946af 100644 --- a/app/app.py +++ b/app/app.py @@ -3,6 +3,7 @@ from dotenv import load_dotenv from litestar import Litestar, get, Response +from litestar.response import Redirect from litestar.openapi import OpenAPIConfig from litestar.config.response_cache import CACHE_FOREVER from litestar.params import Parameter @@ -63,8 +64,11 @@ def generate( async def speakers() -> dict[str, list[str]]: return tts.speakers +@get(["/", "/docs"], include_in_schema=False) +async def docs() -> Redirect: + return Redirect("/schema") app = Litestar( - [generate, speakers], - openapi_config=OpenAPIConfig(title="Silero TTS API", version="1.0.0"), + [generate, speakers, docs], + openapi_config=OpenAPIConfig(title="Silero TTS API", version="1.0.0", root_schema_site="swagger"), )