mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-24 02:39:27 -04:00
⚰️ Remove Python 3.8 from CI and remove Python 3.8 examples from source docs (#14559)
Co-authored-by: Yurii Motov <yurii.motov.monte@gmail.com> Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
This commit is contained in:
815 files changed
+1266
-6546
No files matched your search
@@ -0,0 +1,19 @@
|
||||
from typing import Union
|
||||
|
||||
from fastapi import FastAPI
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
class Item(BaseModel):
|
||||
name: str = Field(examples=["Foo"])
|
||||
description: Union[str, None] = Field(default=None, examples=["A very nice Item"])
|
||||
price: float = Field(examples=[35.4])
|
||||
tax: Union[float, None] = Field(default=None, examples=[3.2])
|
||||
|
||||
|
||||
@app.put("/items/{item_id}")
|
||||
async def update_item(item_id: int, item: Item):
|
||||
results = {"item_id": item_id, "item": item}
|
||||
return results
|
||||
Reference in new issue
Block a user