- Sort Score
- Num 10 results
- Language All
Results 161 - 170 of 543 for item_d (0.04 seconds)
-
docs_src/extra_data_types/tutorial001_py39.py
app = FastAPI() @app.put("/items/{item_id}") async def read_items( item_id: UUID, start_datetime: datetime = Body(), end_datetime: datetime = Body(), process_after: timedelta = Body(), repeat_at: Union[time, None] = Body(default=None), ): start_process = start_datetime + process_after duration = end_datetime - start_process return { "item_id": item_id,
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 755 bytes - Click Count (0) -
tests/test_tutorial/test_query_params/test_tutorial002.py
client = TestClient(mod.app) return client @pytest.mark.parametrize( ("path", "expected_json"), [ ( "/items/foo", {"item_id": "foo"}, ), ( "/items/bar?q=somequery", {"item_id": "bar", "q": "somequery"}, ), ], ) def test_read_user_item(client: TestClient, path, expected_json): response = client.get(path)Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 4.2K bytes - Click Count (0) -
docs_src/body_multiple_params/tutorial001_an_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: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)], q: str | None = None, item: Item | None = None, ): results = {"item_id": item_id} if q: results.update({"q": q})
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 579 bytes - Click Count (0) -
README.md
app = FastAPI() class Item(BaseModel): name: str price: float is_offer: Union[bool, None] = None @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} @app.put("/items/{item_id}") def update_item(item_id: int, item: Item):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Thu Dec 25 11:01:37 GMT 2025 - 26.4K bytes - Click Count (0) -
tests/test_tutorial/test_path_params_numeric_validations/test_tutorial004.py
) return TestClient(mod.app) @pytest.mark.parametrize( "path,expected_response", [ ("/items/42?q=", {"item_id": 42}), ("/items/1?q=somequery", {"item_id": 1, "q": "somequery"}), ], ) def test_read_items(client: TestClient, path, expected_response): response = client.get(path) assert response.status_code == 200, response.textCreated: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 6K bytes - Click Count (0) -
docs_src/body_multiple_params/tutorial001_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: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)], q: Union[str, None] = None, item: Union[Item, None] = None, ): results = {"item_id": item_id}
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 610 bytes - Click Count (0) -
docs_src/query_params_str_validations/tutorial008_an_py310.py
app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ str | None, Query( title="Query string", description="Query string for the items to search in the database that have a good match", min_length=3, ), ] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q})
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 498 bytes - Click Count (0) -
docs_src/additional_responses/tutorial001_py39.py
from fastapi.responses import JSONResponse from pydantic import BaseModel class Item(BaseModel): id: str value: str class Message(BaseModel): message: str app = FastAPI() @app.get("/items/{item_id}", response_model=Item, responses={404: {"model": Message}}) async def read_item(item_id: str): if item_id == "foo": return {"id": "foo", "value": "there goes my hero"}Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 506 bytes - Click Count (0) -
docs_src/dependencies/tutorial008b_an_py39.py
@app.get("/items/{item_id}") def get_item(item_id: str, username: Annotated[str, Depends(get_username)]): if item_id not in data: raise HTTPException(status_code=404, detail="Item not found") item = data[item_id] if item["owner"] != username: raise OwnerError(username)
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 26 20:37:34 GMT 2023 - 775 bytes - Click Count (0) -
tests/test_ambiguous_params.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 20 15:55:38 GMT 2025 - 2K bytes - Click Count (1)