Browse Source

Update code examples in `docs/deployment/docker.md` to follow latest Python syntax

pull/14758/head
Yurii Motov 6 months ago
parent
commit
d346026e17
  1. 4
      docs/en/docs/deployment/docker.md

4
docs/en/docs/deployment/docker.md

@ -145,8 +145,6 @@ There are other formats and tools to define and install package dependencies.
* Create a `main.py` file with: * Create a `main.py` file with:
```Python ```Python
from typing import Union
from fastapi import FastAPI from fastapi import FastAPI
app = FastAPI() app = FastAPI()
@ -158,7 +156,7 @@ def read_root():
@app.get("/items/{item_id}") @app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None): def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q} return {"item_id": item_id, "q": q}
``` ```

Loading…
Cancel
Save