Skip to content

Commit

Permalink
📝 Simplify example for docs for Additional Responses, remove unnecess…
Browse files Browse the repository at this point in the history
…ary `else` (#4693)
  • Loading branch information
adriangb committed Aug 26, 2022
1 parent 96c3f44 commit dde140d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/en/docs/advanced/additional-responses.md
Expand Up @@ -23,7 +23,7 @@ Each of those response `dict`s can have a key `model`, containing a Pydantic mod

For example, to declare another response with a status code `404` and a Pydantic model `Message`, you can write:

```Python hl_lines="18 23"
```Python hl_lines="18 22"
{!../../../docs_src/additional_responses/tutorial001.py!}
```

Expand Down
3 changes: 1 addition & 2 deletions docs_src/additional_responses/tutorial001.py
Expand Up @@ -19,5 +19,4 @@ class Message(BaseModel):
async def read_item(item_id: str):
if item_id == "foo":
return {"id": "foo", "value": "there goes my hero"}
else:
return JSONResponse(status_code=404, content={"message": "Item not found"})
return JSONResponse(status_code=404, content={"message": "Item not found"})

0 comments on commit dde140d

Please sign in to comment.