Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for BaseModel (0.13 sec)

  1. fastapi/routing.py

            Add a *path operation* using an HTTP PUT operation.
    
            ## Example
    
            ```python
            from fastapi import APIRouter, FastAPI
            from pydantic import BaseModel
    
            class Item(BaseModel):
                name: str
                description: str | None = None
    
            app = FastAPI()
            router = APIRouter()
    
            @router.put("/items/{item_id}")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 172.1K bytes
    - Viewed (0)
  2. fastapi/applications.py

                    For example, if you have a model like:
    
                    ```python
                    from pydantic import BaseModel
    
                    class Item(BaseModel):
                        name: str
                        tags: list[str] = []
                    ```
    
                    When `Item` is used for input, a request body, `tags` is not required,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 17 04:52:31 UTC 2024
    - 172.2K bytes
    - Viewed (0)
Back to top