mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-19 05:58:01 +08:00
18 lines
505 B
Python
18 lines
505 B
Python
from fastapi import APIRouter, Depends
|
|
|
|
|
|
def get_db():
|
|
return None
|
|
|
|
|
|
# Router-level dependency listed BEFORE `prefix=` — exercises the
|
|
# balanced-paren scan end-to-end. The old `[^)]*?` regex stopped at the
|
|
# `)` of `Depends(...)` and dropped the prefix, leaving the Route node
|
|
# unprefixed; this route must still resolve to `/v1/items/{item_id}`.
|
|
router = APIRouter(dependencies=[Depends(get_db)], prefix="/items")
|
|
|
|
|
|
@router.get("/{item_id}")
|
|
def get_item(item_id: str):
|
|
return {"id": item_id}
|