no-work-verb-get-route
GET routes must not end in a work verb such as run, send, trigger or retry.
Why
GET must be safe. A GET that dispatches work can be fired cross-site by an image tag or link prefetch, bypasses CSRF protection, and is retried freely by proxies and clients.
Fix
Change the operation to POST and keep GET for reads.
Examples
from fastapi import APIRouter
router = APIRouter()
@router.get("/batches/{batch_id}/retry")async def retry(batch_id: str) -> None: return Nonefrom fastapi import APIRouter
router = APIRouter()
@router.post("/batches/{batch_id}/retry")async def retry(batch_id: str) -> None: return None