Skip to content

Commit ea33e3f

Browse files
committed
fix(types): correct rate_limit_exceeded_handler return type
Change return type from dict[str, str] to dict[str, Any] to match the nested dictionary structure containing Collection types. Adds typing.Any import to support the corrected type annotation. EOF )
1 parent 3388698 commit ea33e3f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/security/rate_limiting.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- Rate limit exceeded handling
88
"""
99

10+
from typing import Any
11+
1012
from fastapi import FastAPI, Request
1113
from slowapi import Limiter, _rate_limit_exceeded_handler
1214
from slowapi.errors import RateLimitExceeded
@@ -89,7 +91,7 @@ def setup_rate_limiting(app: FastAPI) -> None:
8991
# Custom rate limit exceeded handler with logging
9092
async def rate_limit_exceeded_handler(
9193
request: Request, exc: RateLimitExceeded
92-
) -> dict[str, str]:
94+
) -> dict[str, Any]:
9395
"""
9496
Custom handler for rate limit exceeded errors.
9597

0 commit comments

Comments
 (0)