refactor: replace SessionDep with explicit Annotated[Session, Depends(get_session)] across all routers
- Replace SessionDep type alias with explicit Annotated[Session, Depends(get_session)] - Add missing imports for Session, Annotated, and Depends types - Update all endpoint function signatures to use explicit dependency annotation - Remove redundant `= Depends()` default values from session parameters - Update docstrings and comments to reference new annotation pattern - Apply changes consistently across all router
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from sqlalchemy.orm import Session
|
||||
from typing import Annotated
|
||||
from slowapi import Limiter, _rate_limit_exceeded_handler
|
||||
from slowapi.util import get_remote_address
|
||||
from slowapi.errors import RateLimitExceeded
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi import FastAPI, Request, Depends
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import JSONResponse, Response
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
@@ -201,7 +203,7 @@ def create_app() -> FastAPI:
|
||||
docs_url="/docs",
|
||||
redoc_url="/redoc",
|
||||
lifespan=lifespan,
|
||||
# Custom OpenAPI config to handle SessionDep issues
|
||||
# Custom OpenAPI config to handle Annotated[Session, Depends(get_session)] issues
|
||||
openapi_components={
|
||||
"securitySchemes": {
|
||||
"ApiKeyAuth": {
|
||||
|
||||
Reference in New Issue
Block a user