style: clean up unused parameters and imports in examples

This commit is contained in:
2026-02-04 01:08:16 +00:00
parent 6bc108078f
commit d7966f7e96
11 changed files with 143 additions and 95 deletions

View File

@@ -346,7 +346,7 @@ def create_app_with_config() -> FastAPI:
)
@app.exception_handler(RateLimitExceeded)
async def rate_limit_handler(_: Request, exc: RateLimitExceeded) -> JSONResponse:
async def _rate_limit_handler(_: Request, exc: RateLimitExceeded) -> JSONResponse:
return JSONResponse(
status_code=429,
content={
@@ -358,17 +358,17 @@ def create_app_with_config() -> FastAPI:
@app.get("/")
@rate_limit(limit=10, window_size=60)
async def root(_: Request) -> dict[str, str]:
async def _root(_: Request) -> dict[str, str]:
return {"message": "Hello from config-loaded app!"}
@app.get("/health")
async def health() -> dict[str, str]:
async def _health() -> dict[str, str]:
"""Health check - exempt from rate limiting."""
return {"status": "healthy"}
@app.get("/api/data")
@rate_limit(limit=50, window_size=60)
async def get_data(_: Request) -> dict[str, str]:
async def _get_data(_: Request) -> dict[str, str]:
return {"data": "Some API data"}
return app