📝 Simplify example for docs for Additional Responses, remove unnecessary else (#4693)

This commit is contained in:
Adrian Garcia Badaracco authored and GitHub committed 2022-08-26 15:32:30 +02:00
1 parent 96c3f44a0e
commit dde140d8e3
2 files changed
+2 -3

No files matched your search

@@ -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!}
```
+1 -2
View File
@@ -19,5 +19,4 @@ app = FastAPI()
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"})