- Sort Score
- Result 10 results
- Languages All
Results 101 - 110 of 726 for item_a (0.03 sec)
-
docs_src/path_params_numeric_validations/tutorial001_py39.py
from typing import Union from fastapi import FastAPI, Path, Query app = FastAPI() @app.get("/items/{item_id}") async def read_items( item_id: int = Path(title="The ID of the item to get"), q: Union[str, None] = Query(default=None, alias="item-query"), ): results = {"item_id": item_id} if q: results.update({"q": q})
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 364 bytes - Viewed (0) -
docs_src/body/tutorial004_py310.py
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None app = FastAPI() @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item, q: str | None = None): result = {"item_id": item_id, **item.model_dump()} if q: result.update({"q": q})Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 414 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial005_an_py310.py
from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: 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}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 409 bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
from docs_src.path_operation_advanced_configuration.tutorial002_py39 import app client = TestClient(app) def test_get(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1K bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial003_py310.py
app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Item = Body( examples=[ { "name": "Foo", "description": "A very nice Item", "price": 35.4,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 574 bytes - Viewed (0) -
docs_src/body_nested_models/tutorial005_py310.py
class Image(BaseModel): url: HttpUrl name: str class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: set[str] = set() image: Image | None = None @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 468 bytes - Viewed (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial005.py
) return TestClient(mod.app) @pytest.mark.parametrize( "path,expected_response", [ ("/items/1?q=", {"item_id": 1}), ("/items/1000?q=somequery", {"item_id": 1000, "q": "somequery"}), ], ) def test_read_items(client: TestClient, path, expected_response): response = client.get(path) assert response.status_code == 200, response.textRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 6.6K bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial003_an_py310.py
from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None @app.put("/items/{item_id}") async def update_item( item_id: int, item: Annotated[ Item, Body( examples=[ { "name": "Foo",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 673 bytes - Viewed (0) -
docs_src/body/tutorial004_py39.py
from fastapi import FastAPI from pydantic import BaseModel class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None app = FastAPI() @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item, q: Union[str, None] = None): result = {"item_id": item_id, **item.model_dump()} if q: result.update({"q": q})Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 458 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial003_py310.py
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()): results = {"item_id": item_id, "item": item, "user": user, "importance": importance}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 504 bytes - Viewed (0)