update openapi docs for PUT request

This commit is contained in:
jomo 2024-02-01 01:04:49 +01:00
parent 6d01523d8d
commit 2b7342b902

View file

@ -44,7 +44,11 @@ async def list_items(db: Session = Depends(get_db)):
return {i.id: i for i in items} return {i.id: i for i in items}
@app.put("/api/items/{id}") @app.put(
"/api/items/{id}",
status_code=201,
responses={201: {"description": "created"}, 204: {"description": "updated"}},
)
async def put_item(id: str, item: Item, db: Session = Depends(get_db)): async def put_item(id: str, item: Item, db: Session = Depends(get_db)):
if item.last_updated is None: if item.last_updated is None:
item.last_updated = month_timestamp() item.last_updated = month_timestamp()