We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbb2d8f commit fbf2b33Copy full SHA for fbf2b33
app/api/shakespeare.py
@@ -1,4 +1,7 @@
1
-from fastapi import APIRouter, Depends
+from typing import Annotated
2
+
3
+from fastapi import APIRouter, Depends, Query
4
+from pydantic import Required
5
from sqlalchemy.ext.asyncio import AsyncSession
6
7
from app.database import get_db
@@ -11,7 +14,7 @@
11
14
"/",
12
15
)
13
16
async def find_paragraph(
- character: str,
17
+ character: Annotated[str, Query(description="Character name")] = Required,
18
db_session: AsyncSession = Depends(get_db),
19
):
20
return await Paragraph.find(db_session=db_session, character=character)
0 commit comments