Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 41 - 50 of 143 for embeds (0.04 seconds)

  1. docs/zh/docs/tutorial/body-multiple-params.md

    ///
    
    ## 嵌入单个请求体参数
    
    假设你只有一个来自 Pydantic 模型 `Item` 的请求体参数 `item`。
    
    默认情况下,**FastAPI** 将直接期望这样的请求体。
    
    但是,如果你希望它期望一个拥有 `item` 键并在值中包含模型内容的 JSON,就像在声明额外的请求体参数时所做的那样,则可以使用一个特殊的 `Body` 参数 `embed`:
    
    ```Python
    item: Item = Body(embed=True)
    ```
    
    比如:
    
    {* ../../docs_src/body_multiple_params/tutorial005_an_py310.py hl[17] *}
    
    在这种情况下,**FastAPI** 将期望像这样的请求体:
    
    ```JSON hl_lines="2"
    {
        "item": {
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 4.7K bytes
    - Click Count (0)
  2. docs/en/docs/tutorial/path-params.md

    /// tip
    
    You could also access the value `"lenet"` with `ModelName.lenet.value`.
    
    ///
    
    #### Return *enumeration members* { #return-enumeration-members }
    
    You can return *enum members* from your *path operation*, even nested in a JSON body (e.g. a `dict`).
    
    They will be converted to their corresponding values (strings in this case) before returning them to the client:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 9.2K bytes
    - Click Count (0)
  3. docs_src/body_fields/tutorial001_an_py310.py

        )
        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}
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 563 bytes
    - Click Count (0)
  4. docs/uk/docs/tutorial/body-multiple-params.md

    Але якщо Ви хочете, щоб він очікував JSON з ключем `item`, а всередині — вміст моделі (так, як це відбувається при оголошенні додаткових параметрів тіла), Ви можете використати спеціальний параметр `Body` — `embed`:
    
    ```Python
    item: Item = Body(embed=True)
    ```
    
    як у прикладі:
    
    {* ../../docs_src/body_multiple_params/tutorial005_an_py310.py hl[17] *}
    
    У цьому випадку **FastAPI** очікуватиме тіло запиту такого вигляду:
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Fri Feb 28 14:19:00 GMT 2025
    - 7.4K bytes
    - Click Count (0)
  5. docs/distributed/samples/bootstrap-partial.ldif

    objectclass: groupofnames
    cn: projectx
    description: Project X group members
    member: uid=alice1,ou=people,ou=hwengg,dc=min,dc=io
    member: uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io
    
    dn: cn=projecty,ou=groups,ou=hwengg,dc=min,dc=io
    objectclass: groupofnames
    cn: projecty
    description: Project Y group members
    member: uid=bobfisher,ou=people,ou=hwengg,dc=min,dc=io
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Thu Sep 12 15:59:00 GMT 2024
    - 1.4K bytes
    - Click Count (0)
  6. code_of_conduct.md

    * Being respectful of differing viewpoints and experiences
    * Gracefully accepting constructive criticism
    * Focusing on what is best for the community
    * Showing empathy towards other community members
    
    Examples of unacceptable behavior by participants include:
    
    * The use of sexualized language or imagery and unwelcome sexual attention or
      advances
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Mon Jan 20 18:38:58 GMT 2020
    - 3.5K bytes
    - Click Count (0)
  7. .github/dco.yml

    # Disable sign-off checking for members of the Gradle GitHub organization
    require:
    Created: Wed Dec 31 11:36:14 GMT 2025
    - Last Modified: Sat Aug 11 00:03:28 GMT 2018
    - 100 bytes
    - Click Count (0)
  8. docs/en/docs/reference/uploadfile.md

    You can import it directly from `fastapi`:
    
    ```python
    from fastapi import UploadFile
    ```
    
    ::: fastapi.UploadFile
        options:
            members:
                - file
                - filename
                - size
                - headers
                - content_type
                - read
                - write
                - seek
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 472 bytes
    - Click Count (0)
  9. fastapi/params.py

            deprecated: Union[deprecated, str, bool, None] = None,
            include_in_schema: bool = True,
            json_schema_extra: Union[dict[str, Any], None] = None,
            **extra: Any,
        ):
            self.embed = embed
            self.media_type = media_type
            if example is not _Unset:
                warnings.warn(
                    "`example` has been deprecated, please use `examples` instead",
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 26.3K bytes
    - Click Count (0)
  10. docs/ja/docs/tutorial/body-multiple-params.md

    Pydanticモデル`Item`のボディパラメータ`item`を1つだけ持っているとしましょう。
    
    デフォルトでは、**FastAPI**はそのボディを直接期待します。
    
    しかし、追加のボディパラメータを宣言したときのように、キー `item` を持つ JSON とその中のモデルの内容を期待したい場合は、特別な `Body` パラメータ `embed` を使うことができます:
    
    ```Python
    item: Item = Body(..., embed=True)
    ```
    
    以下において:
    
    {* ../../docs_src/body_multiple_params/tutorial005.py hl[17] *}
    
    この場合、**FastAPI** は以下のようなボディを期待します:
    
    ```JSON hl_lines="2"
    {
        "item": {
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 5.7K bytes
    - Click Count (0)
Back to Top