docs/examples/openapi/customize_path.py
raw| 1 | from typing import Dict |
| 2 | |
| 3 | from litestar import Litestar, get |
| 4 | from litestar.openapi.config import OpenAPIConfig |
| 5 | |
| 6 | |
| 7 | @get("/") |
| 8 | def hello_world() -> Dict[str, str]: |
| 9 | return {"message": "Hello World"} |
| 10 | |
| 11 | |
| 12 | app = Litestar( |
| 13 | route_handlers=[hello_world], |
| 14 | openapi_config=OpenAPIConfig( |
| 15 | title="My API", |
| 16 | description="This is the description of my API", |
| 17 | version="0.1.0", |
| 18 | path="/docs", |
| 19 | ), |
| 20 | ) |