Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 410 for Fricke (0.17 sec)

  1. docs_src/schema_extra_example/tutorial004_an_py39.py

        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",
                        "description": "A very nice Item",
                        "price": 35.4,
                        "tax": 3.2,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jul 01 16:43:29 GMT 2023
    - 936 bytes
    - Viewed (0)
  2. docs_src/response_model/tutorial004.py

    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: float = 10.5
        tags: List[str] = []
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2},
        "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []},
    }
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 633 bytes
    - Viewed (0)
  3. docs_src/schema_extra_example/tutorial005.py

                        "price": 35.4,
                        "tax": 3.2,
                    },
                },
                "converted": {
                    "summary": "An example with converted data",
                    "description": "FastAPI can convert price `strings` to actual `numbers` automatically",
                    "value": {
                        "name": "Bar",
                        "price": "35.4",
                    },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 1.4K bytes
    - Viewed (0)
  4. docs_src/generate_clients/tutorial003_py39.py

        return {"message": "Item received"}
    
    
    @app.get("/items/", response_model=list[Item], tags=["items"])
    async def get_items():
        return [
            {"name": "Plumbus", "price": 3},
            {"name": "Portal Gun", "price": 9001},
        ]
    
    
    @app.post("/users/", response_model=ResponseMessage, tags=["users"])
    async def create_user(user: User):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 04 22:02:18 GMT 2022
    - 914 bytes
    - Viewed (0)
  5. tests/test_union_body.py

    
    class OtherItem(BaseModel):
        price: int
    
    
    @app.post("/items/")
    def save_union_body(item: Union[OtherItem, Item]):
        return {"item": item}
    
    
    client = TestClient(app)
    
    
    def test_post_other_item():
        response = client.post("/items/", json={"price": 100})
        assert response.status_code == 200, response.text
        assert response.json() == {"item": {"price": 100}}
    
    
    def test_post_item():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.6K bytes
    - Viewed (0)
  6. docs_src/body_updates/tutorial001_py39.py

        name: Union[str, None] = None
        description: Union[str, None] = None
        price: Union[float, None] = None
        tax: float = 10.5
        tags: list[str] = []
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2},
        "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []},
    }
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 900 bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial006.py

    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: float = 10.5
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2},
        "baz": {
            "name": "Baz",
            "description": "There goes my baz",
            "price": 50.2,
            "tax": 10.5,
        },
    }
    
    
    @app.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 848 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py

    
    def test_post_body_q_bar_content(client: TestClient):
        response = client.put("/items/5?q=bar", json={"name": "Foo", "price": 50.5})
        assert response.status_code == 200
        assert response.json() == {
            "item_id": 5,
            "item": {
                "name": "Foo",
                "price": 50.5,
                "description": None,
                "tax": None,
            },
            "q": "bar",
        }
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_schema_extra_example/test_tutorial005.py

                                                "price": 35.4,
                                                "tax": 3.2,
                                            },
                                        },
                                        "converted": {
                                            "summary": "An example with converted data",
                                            "description": "FastAPI can convert price `strings` to actual `numbers` automatically",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 6.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_schema_extra_example/test_tutorial005_py310.py

                                                "price": 35.4,
                                                "tax": 3.2,
                                            },
                                        },
                                        "converted": {
                                            "summary": "An example with converted data",
                                            "description": "FastAPI can convert price `strings` to actual `numbers` automatically",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 26 18:03:13 GMT 2023
    - 6.8K bytes
    - Viewed (0)
Back to top