Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 784 for itemId (0.07 sec)

  1. tests/test_route_scope.py

        route: APIRoute = request.scope["route"]
        return {"user_id": user_id, "path": route.path}
    
    
    @app.websocket("/items/{item_id}")
    async def websocket_item(item_id: str, websocket: WebSocket):
        route: APIWebSocketRoute = websocket.scope["route"]
        await websocket.accept()
        await websocket.send_json({"item_id": item_id, "path": route.path})
    
    
    client = TestClient(app)
    
    
    def test_get():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 03:29:38 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  2. docs_src/extra_models/tutorial003_py39.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):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 644 bytes
    - Viewed (0)
  3. tests/test_extra_routes.py

    def delete_item(item_id: str, item: Item):
        return {"item_id": item_id, "item": item}
    
    
    @app.head("/items/{item_id}")
    def head_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    @app.options("/items/{item_id}")
    def options_item(item_id: str):
        return JSONResponse(None, headers={"x-fastapi-item-id": item_id})
    
    
    @app.patch("/items/{item_id}")
    def patch_item(item_id: str, item: Item):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 13.5K bytes
    - Viewed (0)
  4. docs_src/additional_status_codes/tutorial001_py310.py

    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: str | None = Body(default=None),
        size: int | None = Body(default=None),
    ):
        if item_id in items:
            item = items[item_id]
            item["name"] = name
            item["size"] = size
            return item
        else:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 646 bytes
    - Viewed (0)
  5. docs_src/body_updates/tutorial001_py39.py

    }
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_item(item_id: str):
        return items[item_id]
    
    
    @app.put("/items/{item_id}", response_model=Item)
    async def update_item(item_id: str, item: Item):
        update_item_encoded = jsonable_encoder(item)
        items[item_id] = update_item_encoded
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 900 bytes
    - Viewed (0)
  6. docs_src/templates/templates/item.html

    <html>
    <head>
        <title>Item Details</title>
        <link href="{{ url_for('static', path='/styles.css') }}" rel="stylesheet">
    </head>
    <body>
        <h1><a href="{{ url_for('read_item', id=id) }}">Item ID: {{ id }}</a></h1>
    </body>
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Thu Jan 11 22:25:37 UTC 2024
    - 235 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_body_multiple_params/test_tutorial005.py

        response = client.put(
            "/items/5",
            json={
                "item": {
                    "name": "Foo",
                    "price": 50.5,
                    "description": "Some Foo",
                    "tax": 0.1,
                },
            },
        )
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {
                "name": "Foo",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_fields/test_tutorial001.py

    def test_items_5(client: TestClient):
        response = client.put("/items/5", json={"item": {"name": "Foo", "price": 3.0}})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {"name": "Foo", "price": 3.0, "description": None, "tax": None},
        }
    
    
    def test_items_6(client: TestClient):
        response = client.put(
            "/items/6",
            json={
                "item": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 6.3K bytes
    - Viewed (0)
  9. 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)
  10. tests/test_tutorial/test_body_nested_models/test_tutorial001_tutorial002_tutorial003.py

            "paths": {
                "/items/{item_id}": {
                    "put": {
                        "parameters": [
                            {
                                "in": "path",
                                "name": "item_id",
                                "required": True,
                                "schema": {
                                    "title": "Item Id",
                                    "type": "integer",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7.9K bytes
    - Viewed (0)
Back to top