diff --git a/views.py b/views.py index 17f9248..bd9298c 100644 --- a/views.py +++ b/views.py @@ -4,10 +4,12 @@ from lnbits.decorators import check_user_exists from lnbits.helpers import template_renderer -example_ext_generic = APIRouter() +example_ext_generic = APIRouter(tags=["example"]) -@example_ext_generic.get("/", response_class=HTMLResponse) +@example_ext_generic.get( + "/", description="Example generic endpoint", response_class=HTMLResponse +) async def index( request: Request, user: User = Depends(check_user_exists), diff --git a/views_api.py b/views_api.py index e18daa1..02906ac 100644 --- a/views_api.py +++ b/views_api.py @@ -4,10 +4,13 @@ # views_api.py is for you API endpoints that could be hit by another service -example_ext_api = APIRouter() +example_ext_api = APIRouter( + prefix="/api/v1", + tags=["example"], +) -@example_ext_api.get("/api/v1/test/{test_data}") -async def api_example(test_data: str) -> Example: +@example_ext_api.get("/{example_data}", description="Example API endpoint") +async def api_example(example_data: str) -> Example: # Do some python things and return the data - return Example(id="1", wallet=test_data) + return Example(id="1", wallet=example_data)