📝 Update docs, add first tutorials

This commit is contained in:
Sebastián Ramírez
2018-12-14 14:27:02 +04:00
parent 400a4a99af
commit 093bb4cd19
90 changed files with 518 additions and 27 deletions

View File

@@ -0,0 +1,29 @@
from fastapi import Body, FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
description: str = None
price: float
tax: float = None
class User(BaseModel):
username: str
full_name: str = None
@app.put("/items/{item_id}")
async def update_item(
*, item_id: int, item: Item, user: User, access_token: str = Body(...)
):
results = {
"item_id": item_id,
"item": item,
"user": user,
"access_token": access_token,
}
return results