- Sort Score
- Num 10 results
- Language All
Results 191 - 200 of 667 for item_e (0.04 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs_src/custom_response/tutorial001_py39.py
from fastapi import FastAPI from fastapi.responses import UJSONResponse app = FastAPI() @app.get("/items/", response_class=UJSONResponse) async def read_items():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 197 bytes - Click Count (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py
"items": [{"item_id": "Foo"}, {"item_id": "Bar"}], "q": "fixedquery", } 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"}]} def test_query_params_str_validations_item_query_nonregexquery(client: TestClient):Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 5.8K bytes - Click Count (0) -
docs_src/app_testing/tutorial003_py39.py
app = FastAPI() items = {} @app.on_event("startup") async def startup_event(): items["foo"] = {"name": "Fighters"} items["bar"] = {"name": "Tenders"} @app.get("/items/{item_id}") async def read_items(item_id: str): return items[item_id] def test_read_items(): with TestClient(app) as client: response = client.get("/items/foo")
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 528 bytes - Click Count (0) -
docs_src/schema_extra_example/tutorial005_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( openapi_examples={ "normal": {
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Aug 26 18:03:13 GMT 2023 - 1.5K bytes - Click Count (0) -
docs_src/response_model/tutorial004_py39.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 627 bytes - Click Count (0) -
docs_src/extra_models/tutorial003_py310.py
size: int items = { "item1": {"description": "All my friends drive a low rider", "type": "car"}, "item2": { "description": "Music is my aeroplane, it's my aeroplane", "type": "plane", "size": 5, }, } @app.get("/items/{item_id}", response_model=Union[PlaneItem, CarItem]) async def read_item(item_id: str):Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 644 bytes - Click Count (0) -
tests/test_tutorial/test_body/test_tutorial003.py
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 5.5K bytes - Click Count (0) -
docs/de/docs/index.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: Fri Dec 26 09:39:53 GMT 2025 - 25.8K bytes - Click Count (1) -
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/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)