Skip to content

Commit 6609e9a

Browse files
authored
Merge pull request #80 from grillazz/74-add-sqlalchemy-20
try query param annotaions
2 parents 83f2115 + fbf2b33 commit 6609e9a

File tree

2 files changed

+928
-929
lines changed

2 files changed

+928
-929
lines changed

app/api/shakespeare.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from fastapi import APIRouter, Depends
1+
from typing import Annotated
2+
3+
from fastapi import APIRouter, Depends, Query
4+
from pydantic import Required
25
from sqlalchemy.ext.asyncio import AsyncSession
36

47
from app.database import get_db
@@ -11,7 +14,7 @@
1114
"/",
1215
)
1316
async def find_paragraph(
14-
character: str,
17+
character: Annotated[str, Query(description="Character name")] = Required,
1518
db_session: AsyncSession = Depends(get_db),
1619
):
1720
return await Paragraph.find(db_session=db_session, character=character)

0 commit comments

Comments
 (0)