mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-06 22:57:06 -04:00
📝 Fix typing issue in docs_src/app_testing/app_b code example (#14573)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
This commit is contained in:
@@ -34,5 +34,5 @@ async def create_item(item: Item, x_token: Annotated[str, Header()]) -> Item:
|
||||
raise HTTPException(status_code=400, detail="Invalid X-Token header")
|
||||
if item.id in fake_db:
|
||||
raise HTTPException(status_code=409, detail="Item already exists")
|
||||
fake_db[item.id] = item
|
||||
fake_db[item.id] = item.model_dump()
|
||||
return item
|
||||
|
||||
@@ -34,5 +34,5 @@ async def create_item(item: Item, x_token: Annotated[str, Header()]) -> Item:
|
||||
raise HTTPException(status_code=400, detail="Invalid X-Token header")
|
||||
if item.id in fake_db:
|
||||
raise HTTPException(status_code=409, detail="Item already exists")
|
||||
fake_db[item.id] = item
|
||||
fake_db[item.id] = item.model_dump()
|
||||
return item
|
||||
|
||||
@@ -32,5 +32,5 @@ async def create_item(item: Item, x_token: str = Header()) -> Item:
|
||||
raise HTTPException(status_code=400, detail="Invalid X-Token header")
|
||||
if item.id in fake_db:
|
||||
raise HTTPException(status_code=409, detail="Item already exists")
|
||||
fake_db[item.id] = item
|
||||
fake_db[item.id] = item.model_dump()
|
||||
return item
|
||||
|
||||
@@ -34,5 +34,5 @@ async def create_item(item: Item, x_token: str = Header()) -> Item:
|
||||
raise HTTPException(status_code=400, detail="Invalid X-Token header")
|
||||
if item.id in fake_db:
|
||||
raise HTTPException(status_code=409, detail="Item already exists")
|
||||
fake_db[item.id] = item
|
||||
fake_db[item.id] = item.model_dump()
|
||||
return item
|
||||
|
||||
Reference in New Issue
Block a user