Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 21 - 30 of 167 for response_mode (0.08 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. docs/en/docs/advanced/response-cookies.md

    And if you declared a `response_model`, it will still be used to filter and convert the object you returned.
    
    **FastAPI** will use that *temporal* response to extract the cookies (also headers and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 2.3K bytes
    - Click Count (0)
  2. docs_src/body_updates/tutorial002_py310.py

        "baz": {"name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": []},
    }
    
    
    @app.get("/items/{item_id}", response_model=Item)
    async def read_item(item_id: str):
        return items[item_id]
    
    
    @app.patch("/items/{item_id}", response_model=Item)
    async def update_item(item_id: str, item: Item):
        stored_item_data = items[item_id]
        stored_item_model = Item(**stored_item_data)
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 1022 bytes
    - Click Count (0)
  3. tests/test_serialize_response.py

        owner_ids: Optional[list[int]] = None
    
    
    @app.get("/items/valid", response_model=Item)
    def get_valid():
        return {"name": "valid", "price": 1.0}
    
    
    @app.get("/items/coerce", response_model=Item)
    def get_coerce():
        return {"name": "coerce", "price": "1.0"}
    
    
    @app.get("/items/validlist", response_model=list[Item])
    def get_validlist():
        return [
            {"name": "foo"},
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.4K bytes
    - Click Count (0)
  4. docs/ru/docs/advanced/dataclasses.md

    Но если у вас уже есть набор dataclasses, это полезный приём — задействовать их для веб-API на FastAPI. 🤓
    
    ///
    
    ## Dataclasses в `response_model` { #dataclasses-in-response-model }
    
    Вы также можете использовать `dataclasses` в параметре `response_model`:
    
    {* ../../docs_src/dataclasses_/tutorial002_py310.py hl[1,6:12,18] *}
    
    Этот dataclass будет автоматически преобразован в Pydantic dataclass.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Dec 26 10:43:02 GMT 2025
    - 6.6K bytes
    - Click Count (0)
  5. tests/test_response_model_data_filter_no_inheritance.py

    class PetDB(BaseModel):
        name: str
        owner: UserDB
    
    
    class PetOut(BaseModel):
        name: str
        owner: User
    
    
    @app.post("/users/", response_model=User)
    async def create_user(user: UserCreate):
        return user
    
    
    @app.get("/pets/{pet_id}", response_model=PetOut)
    async def read_pet(pet_id: int):
        user = UserDB(
            email="******@****.***",
            hashed_password="secrethashed",
        )
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 1.7K bytes
    - Click Count (0)
  6. docs_src/generate_clients/tutorial003_py39.py

        message: str
    
    
    class User(BaseModel):
        username: str
        email: str
    
    
    @app.post("/items/", response_model=ResponseMessage, tags=["items"])
    async def create_item(item: Item):
        return {"message": "Item received"}
    
    
    @app.get("/items/", response_model=list[Item], tags=["items"])
    async def get_items():
        return [
            {"name": "Plumbus", "price": 3},
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Mar 04 22:02:18 GMT 2022
    - 914 bytes
    - Click Count (0)
  7. docs_src/sql_databases/tutorial002_an_py310.py

    @app.on_event("startup")
    def on_startup():
        create_db_and_tables()
    
    
    @app.post("/heroes/", response_model=HeroPublic)
    def create_hero(hero: HeroCreate, session: SessionDep):
        db_hero = Hero.model_validate(hero)
        session.add(db_hero)
        session.commit()
        session.refresh(db_hero)
        return db_hero
    
    
    @app.get("/heroes/", response_model=list[HeroPublic])
    def read_heroes(
        session: SessionDep,
        offset: int = 0,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Oct 09 19:44:42 GMT 2024
    - 2.5K bytes
    - Click Count (0)
  8. docs_src/generate_clients/tutorial002_py39.py

        message: str
    
    
    class User(BaseModel):
        username: str
        email: str
    
    
    @app.post("/items/", response_model=ResponseMessage, tags=["items"])
    async def create_item(item: Item):
        return {"message": "Item received"}
    
    
    @app.get("/items/", response_model=list[Item], tags=["items"])
    async def get_items():
        return [
            {"name": "Plumbus", "price": 3},
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Mar 04 22:02:18 GMT 2022
    - 730 bytes
    - Click Count (0)
  9. docs/ja/docs/tutorial/response-model.md

    ///
    
    ## 出力モデルの追加
    
    代わりに、平文のパスワードを持つ入力モデルと、パスワードを持たない出力モデルを作成することができます:
    
    {* ../../docs_src/response_model/tutorial003.py hl[9,11,16] *}
    
    ここでは、*path operation関数*がパスワードを含む同じ入力ユーザーを返しているにもかかわらず:
    
    {* ../../docs_src/response_model/tutorial003.py hl[24] *}
    
    ...`response_model`を`UserOut`と宣言したことで、パスワードが含まれていません:
    
    {* ../../docs_src/response_model/tutorial003.py hl[22] *}
    
    そのため、**FastAPI** は出力モデルで宣言されていない全てのデータをフィルタリングしてくれます(Pydanticを使用)。
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 9K bytes
    - Click Count (0)
  10. docs/en/docs/advanced/response-change-status-code.md

    And if you declared a `response_model`, it will still be used to filter and convert the object you returned.
    
    **FastAPI** will use that *temporal* response to extract the status code (also cookies and headers), and will put them in the final response that contains the value you returned, filtered by any `response_model`.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 1.5K bytes
    - Click Count (0)
Back to Top