Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for response (0.17 sec)

  1. docs/en/docs/tutorial/extra-models.md

    === "Python 3.8+"
    
        ```Python hl_lines="9  15-16  19-20  23-24"
        {!> ../../../docs_src/extra_models/tutorial002.py!}
        ```
    
    ## `Union` or `anyOf`
    
    You can declare a response to be the `Union` of two types, that means, that the response would be any of the two.
    
    It will be defined in OpenAPI with `anyOf`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  2. docs/ru/docs/tutorial/extra-models.md

        {!> ../../../docs_src/extra_models/tutorial003.py!}
        ```
    
    ### `Union` в Python 3.10
    
    В этом примере мы передаём `Union[PlaneItem, CarItem]` в качестве значения аргумента `response_model`.
    
    Поскольку мы передаём его как **значение аргумента** вместо того, чтобы поместить его в **аннотацию типа**, нам придётся использовать `Union` даже в Python 3.10.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. docs/pt/docs/tutorial/extra-models.md

    Dado que estamos passando-o como um **valor para um argumento** em vez de colocá-lo em uma **anotação de tipo**, precisamos usar `Union` mesmo no Python 3.10.
    
    Se estivesse em uma anotação de tipo, poderíamos ter usado a barra vertical, como:
    
    ```Python
    some_variable: PlaneItem | CarItem
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/extra-models.md

        ```
    
    ### `Union` 🐍 3️⃣.1️⃣0️⃣
    
    👉 🖼 👥 🚶‍♀️ `Union[PlaneItem, CarItem]` 💲 ❌ `response_model`.
    
    ↩️ 👥 🚶‍♀️ ⚫️ **💲 ❌** ↩️ 🚮 ⚫️ **🆎 ✍**, 👥 ✔️ ⚙️ `Union` 🐍 3️⃣.1️⃣0️⃣.
    
    🚥 ⚫️ 🆎 ✍ 👥 💪 ✔️ ⚙️ ⏸ ⏸,:
    
    ```Python
    some_variable: PlaneItem | CarItem
    ```
    
    ✋️ 🚥 👥 🚮 👈 `response_model=PlaneItem | CarItem` 👥 🔜 🤚 ❌, ↩️ 🐍 🔜 🔄 🎭 **❌ 🛠️** 🖖 `PlaneItem` & `CarItem` ↩️ 🔬 👈 🆎 ✍.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/extra-models.md

    ```Python
    some_variable: PlaneItem | CarItem
    ```
    
    Aber wenn wir das in der Zuweisung `response_model=PlaneItem | CarItem` machen, erhalten wir eine Fehlermeldung, da Python versucht, eine **ungültige Operation** zwischen `PlaneItem` und `CarItem` durchzuführen, statt es als Typannotation zu interpretieren.
    
    ## Listen von Modellen
    
    Genauso können Sie eine Response deklarieren, die eine Liste von Objekten ist.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:26:47 GMT 2024
    - 8.7K bytes
    - Viewed (0)
Back to top