committed by
GitHub
4 changed files with 8 additions and 1 deletions
@ -1,12 +1,15 @@ |
|||
from typing import Optional |
|||
|
|||
from fastapi import FastAPI |
|||
from pydantic import BaseModel |
|||
|
|||
app = FastAPI() |
|||
|
|||
|
|||
class Item(BaseModel): |
|||
description: Optional[str] |
|||
|
|||
|
|||
@app.post("/items/") |
|||
async def create_item(item: Item): |
|||
return item |
|||
|
|||
Loading…
Reference in new issue