Browse Source
📝 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 <[email protected]>
pull/14816/head
Tima
4 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
4 additions and
4 deletions
-
docs_src/app_testing/app_b_an_py310/main.py
-
docs_src/app_testing/app_b_an_py39/main.py
-
docs_src/app_testing/app_b_py310/main.py
-
docs_src/app_testing/app_b_py39/main.py
|
|
|
@ -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 |
|
|
|
|