- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 1,738 for item (0.17 sec)
-
docs_src/body_multiple_params/tutorial005_an_py39.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Annotated[Item, Body(embed=True)]): results = {"item_id": item_id, "item": item}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 428 bytes - Viewed (0) -
docs_src/body_nested_models/tutorial003.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: Set[str] = set() @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 414 bytes - Viewed (0) -
docs_src/query_params/tutorial003_py310.py
from fastapi import FastAPI app = FastAPI() @app.get("/items/{item_id}") async def read_item(item_id: str, q: str | None = None, short: bool = False): item = {"item_id": item_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} )
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 374 bytes - Viewed (0) -
docs_src/query_params/tutorial004.py
app = FastAPI() @app.get("/users/{user_id}/items/{item_id}") async def read_user_item( user_id: int, item_id: str, q: Union[str, None] = None, short: bool = False ): item = {"item_id": item_id, "owner_id": user_id} if q: item.update({"q": q}) if not short: item.update( {"description": "This is an amazing item that has a long description"} )
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 468 bytes - Viewed (0) -
tests/test_union_inherited_body.py
app = FastAPI() class Item(BaseModel): name: Optional[str] = None class ExtendedItem(Item): age: int @app.post("/items/") def save_union_different_body(item: Union[ExtendedItem, Item]): return {"item": item} client = TestClient(app) def test_post_extended_item(): response = client.post("/items/", json={"name": "Foo", "age": 5})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 5.2K bytes - Viewed (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py
}, "summary": "Update Item", "operationId": "update_item_items__item_id__put", "parameters": [ { "required": True, "schema": { "title": "The ID of the item to get", "maximum": 1000.0,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.5K bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004_py310.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Item, user: User, importance: int = Body(gt=0),
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Mar 10 18:49:18 GMT 2023 - 603 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004_an.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 703 bytes - Viewed (0) -
tests/test_tutorial/test_body_fields/test_tutorial001_an_py310.py
}, }, "Body_update_item_items__item_id__put": { "title": "Body_update_item_items__item_id__put", "required": ["item"], "type": "object", "properties": {"item": {"$ref": "#/components/schemas/Item"}}, }, "ValidationError": {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.3K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial004.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 5.4K bytes - Viewed (0)