- Sort Score
- Result 10 results
- Languages All
Results 881 - 890 of 1,169 for def2 (0.04 sec)
-
tests/test_validate_response_recursive/test_validate_response_recursive_pv1.py
from fastapi.testclient import TestClient from ..utils import needs_pydanticv1 @needs_pydanticv1 def test_recursive(): from .app_pv1 import app client = TestClient(app) response = client.get("/items/recursive") assert response.status_code == 200, response.text assert response.json() == { "sub_items": [{"name": "subitem", "sub_items": []}], "name": "item", }
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 900 bytes - Viewed (0) -
docs_src/additional_responses/tutorial003.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 837 bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001_an.py
from typing_extensions import Annotated app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Annotated[Union[str, None], Body()] = None, size: Annotated[Union[int, None], Body()] = None, ): if item_id in items: item = items[item_id]
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 734 bytes - Viewed (0) -
docs_src/header_param_models/tutorial001_py39.py
class CommonHeaders(BaseModel): host: str save_data: bool if_modified_since: Union[str, None] = None traceparent: Union[str, None] = None x_tag: list[str] = [] @app.get("/items/") async def read_items(headers: CommonHeaders = Header()):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 390 bytes - Viewed (0) -
docs_src/cookie_param_models/tutorial002_pv1_an_py39.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 406 bytes - Viewed (0) -
tests/test_tutorial/test_advanced_middleware/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.advanced_middleware.tutorial001 import app def test_middleware(): client = TestClient(app, base_url="https://testserver") response = client.get("/") assert response.status_code == 200, response.text client = TestClient(app) response = client.get("/", follow_redirects=False) assert response.status_code == 307, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Nov 13 14:26:09 UTC 2022 - 474 bytes - Viewed (0) -
docs_src/response_model/tutorial004_py310.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 595 bytes - Viewed (0) -
docs_src/schema_extra_example/tutorial004_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: Item = Body( examples=[ { "name": "Foo", "description": "A very nice Item", "price": 35.4,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jul 01 16:43:29 UTC 2023 - 786 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial001_py39.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 401 bytes - Viewed (0) -
docs_src/cookie_param_models/tutorial002_pv1_an.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 435 bytes - Viewed (0)