Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 177 for Tax (0.01 sec)

  1. docs_src/body_multiple_params/tutorial004_py310.py

    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    class User(BaseModel):
        username: str
        full_name: str | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item,
        user: User,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Mar 10 18:49:18 UTC 2023
    - 603 bytes
    - Viewed (0)
  2. docs_src/body_multiple_params/tutorial004_py39.py

    from typing import Union
    
    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
    
    
    class User(BaseModel):
        username: str
        full_name: Union[str, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 653 bytes
    - Viewed (0)
  3. docs_src/body/tutorial001_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 271 bytes
    - Viewed (0)
  4. docs_src/dataclasses_/tutorial001_py310.py

    from dataclasses import dataclass
    
    from fastapi import FastAPI
    
    
    @dataclass
    class Item:
        name: str
        price: float
        description: str | None = None
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 275 bytes
    - Viewed (0)
  5. docs_src/schema_extra_example/tutorial002_py39.py

    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str = Field(examples=["Foo"])
        description: Union[str, None] = Field(default=None, examples=["A very nice Item"])
        price: float = Field(examples=[35.4])
        tax: Union[float, None] = Field(default=None, examples=[3.2])
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item):
        results = {"item_id": item_id, "item": item}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 517 bytes
    - Viewed (0)
  6. docs_src/path_operation_configuration/tutorial002_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: set[str] = set()
    
    
    @app.post("/items/", response_model=Item, tags=["items"])
    async def create_item(item: Item):
        return item
    
    
    @app.get("/items/", tags=["items"])
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 575 bytes
    - Viewed (0)
  7. docs_src/body_multiple_params/tutorial003_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
    
    
    class User(BaseModel):
        username: str
        full_name: Union[str, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 575 bytes
    - Viewed (0)
  8. docs_src/body_multiple_params/tutorial001_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Path
    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: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: str | None = None,
        item: Item | None = None,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 579 bytes
    - Viewed (0)
  9. docs_src/body_fields/tutorial001_an_py310.py

        name: str
        description: str | None = Field(
            default=None, title="The description of the item", max_length=300
        )
        price: float = Field(gt=0, description="The price must be greater than zero")
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Annotated[Item, Body(embed=True)]):
        results = {"item_id": item_id, "item": item}
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 563 bytes
    - Viewed (0)
  10. docs_src/body_multiple_params/tutorial001_an_py39.py

    from fastapi import FastAPI, Path
    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,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 610 bytes
    - Viewed (0)
Back to top