- Sort Score
- Result 10 results
- Languages All
Results 81 - 90 of 540 for item_d (0.03 sec)
-
docs_src/schema_extra_example/tutorial004_an_py39.py
from fastapi import Body, FastAPI 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( examples=[ { "name": "Foo",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Jul 01 16:43:29 UTC 2023 - 936 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004_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 class User(BaseModel): username: str full_name: Union[str, None] = None @app.put("/items/{item_id}") async def update_item( *, item_id: int, item: Item, user: User, importance: int = Body(gt=0),
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 653 bytes - Viewed (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial006.py
) return TestClient(mod.app) @pytest.mark.parametrize( "path,expected_response", [ ( "/items/0?q=&size=0.1", {"item_id": 0, "size": 0.1}, ), ( "/items/1000?q=somequery&size=10.4", {"item_id": 1000, "q": "somequery", "size": 10.4}, ), ], ) def test_read_items(client: TestClient, path, expected_response):Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7.3K bytes - Viewed (0) -
tests/test_tutorial/test_query_params/test_tutorial003.py
@pytest.mark.parametrize( ("path", "expected_json"), [ ( "/items/foo", { "item_id": "foo", "description": "This is an amazing item that has a long description", }, ), ( "/items/bar?q=somequery", { "item_id": "bar", "q": "somequery",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 4.9K bytes - Viewed (0) -
docs_src/query_params/tutorial002_py310.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 219 bytes - Viewed (0) -
docs_src/path_params/tutorial002_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 143 bytes - Viewed (0) -
tests/test_put_no_body.py
from fastapi.testclient import TestClient app = FastAPI() @app.put("/items/{item_id}") def save_item_no_body(item_id: str): return {"item_id": item_id} client = TestClient(app) def test_put_no_body(): response = client.put("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"item_id": "foo"} def test_put_no_body_with_body():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.3K bytes - Viewed (0) -
docs_src/query_params/tutorial002_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 251 bytes - Viewed (0) -
tests/test_validation_error_context.py
await websocket.close() # pragma: no cover @sub_app.websocket("/ws/{item_id}") async def subapp_websocket_endpoint(websocket: WebSocket, item_id: int): await websocket.accept() # pragma: no cover await websocket.send_text(f"Item: {item_id}") # pragma: no cover await websocket.close() # pragma: no cover client = TestClient(app)
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 06 12:21:57 UTC 2025 - 4.7K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial008.py
response = client.get("/items/") assert response.status_code == 200 assert response.json() == {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} def test_query_params_str_validations_q_fixedquery(client: TestClient): response = client.get("/items/", params={"q": "fixedquery"}) assert response.status_code == 200 assert response.json() == { "items": [{"item_id": "Foo"}, {"item_id": "Bar"}],
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 4.9K bytes - Viewed (0)