Debian Codegraph @

docs/examples/openapi/plugins/serving_multiple_uis.py

raw
1 from typing import Dict
2
3 from litestar import Litestar, get
4 from litestar.openapi.config import OpenAPIConfig
5 from litestar.openapi.plugins import RapidocRenderPlugin, SwaggerRenderPlugin
6
7
8 @get("/", sync_to_thread=False)
9 def hello_world() -> Dict[str, str]:
10 return {"message": "Hello World"}
11
12
13 app = Litestar(
14 route_handlers=[hello_world],
15 openapi_config=OpenAPIConfig(
16 title="Litestar Example",
17 description="Example of litestar",
18 version="0.0.1",
19 render_plugins=[RapidocRenderPlugin(), SwaggerRenderPlugin()],
20 ),
21 )