mirror of https://github.com/tiangolo/fastapi.git
📝 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:
parent
b134f406d1
commit
9df1f8293d
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue