mirror of
https://github.com/fastapi/fastapi.git
synced 2026-05-25 00:37:44 -04:00
📝 Use return type annotation instead of response_model when possible (#14753)
This commit is contained in:
@@ -12,8 +12,8 @@ class Item(BaseModel):
|
||||
tags: set[str] = set()
|
||||
|
||||
|
||||
@app.post("/items/", response_model=Item, tags=["items"])
|
||||
async def create_item(item: Item):
|
||||
@app.post("/items/", tags=["items"])
|
||||
async def create_item(item: Item) -> Item:
|
||||
return item
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user