Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 311 - 320 of 542 for Annotated (0.34 seconds)

  1. docs/es/docs/tutorial/path-params-numeric-validations.md

    Primero, importa `Path` de `fastapi`, e importa `Annotated`:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *}
    
    /// info | Información
    
    FastAPI agregó soporte para `Annotated` (y comenzó a recomendar su uso) en la versión 0.95.0.
    
    Si tienes una versión anterior, obtendrás errores al intentar usar `Annotated`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:15:55 GMT 2026
    - 6.4K bytes
    - Click Count (0)
  2. docs/ru/docs/tutorial/path-params-numeric-validations.md

    Сначала импортируйте `Path` из `fastapi`, а также импортируйте `Annotated`:
    
    {* ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py hl[1,3] *}
    
    /// info | Информация
    
    Поддержка `Annotated` была добавлена в FastAPI начиная с версии 0.95.0 (и с этой версии рекомендуется использовать этот подход).
    
    Если вы используете более старую версию, вы столкнётесь с ошибками при попытке использовать `Annotated`.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:56:20 GMT 2026
    - 10.5K bytes
    - Click Count (0)
  3. docs_src/dependencies/tutorial008_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends
    
    
    async def dependency_a():
        dep_a = generate_dep_a()
        try:
            yield dep_a
        finally:
            dep_a.close()
    
    
    async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]):
        dep_b = generate_dep_b()
        try:
            yield dep_b
        finally:
            dep_b.close(dep_a)
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 521 bytes
    - Click Count (0)
  4. tests/test_form_default.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, Form
    from starlette.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.post("/urlencoded")
    async def post_url_encoded(age: Annotated[int | None, Form()] = None):
        return age
    
    
    @app.post("/multipart")
    async def post_multi_part(
        age: Annotated[int | None, Form()] = None,
        file: Annotated[bytes | None, File()] = None,
    ):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 829 bytes
    - Click Count (0)
  5. docs/uk/docs/tutorial/dependencies/sub-dependencies.md

    //// tab | Python 3.10+
    
    ```Python hl_lines="1"
    async def needy_dependency(fresh_value: Annotated[str, Depends(get_value, use_cache=False)]):
        return {"fresh_value": fresh_value}
    ```
    
    ////
    
    //// tab | Python 3.10+ без Annotated
    
    /// tip | Порада
    
    Надавайте перевагу версії з `Annotated`, якщо це можливо.
    
    ///
    
    ```Python hl_lines="1"
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Feb 14 08:43:14 GMT 2026
    - 5.7K bytes
    - Click Count (0)
  6. docs/zh/docs/tutorial/dependencies/index.md

    只要把它传给 `Depends`,**FastAPI** 就知道该怎么做了。
    
    ///
    
    ## 共享 `Annotated` 依赖项 { #share-annotated-dependencies }
    
    在上面的示例中,你会发现这里有一点点**代码重复**。
    
    当你需要使用 `common_parameters()` 这个依赖时,你必须写出完整的带类型注解和 `Depends()` 的参数:
    
    ```Python
    commons: Annotated[dict, Depends(common_parameters)]
    ```
    
    但因为我们使用了 `Annotated`,可以把这个 `Annotated` 的值存到一个变量里,在多个地方复用:
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 8.7K bytes
    - Click Count (0)
  7. docs/tr/docs/tutorial/dependencies/index.md

    Sonra da bu değerleri içeren bir `dict` döndürür.
    
    /// info | Bilgi
    
    FastAPI, `Annotated` desteğini 0.95.0 sürümünde ekledi (ve önermeye başladı).
    
    Daha eski bir sürüm kullanıyorsanız `Annotated` kullanmaya çalıştığınızda hata alırsınız.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 10.2K bytes
    - Click Count (0)
  8. tests/test_stringified_annotations_simple.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, Request
    from fastapi.testclient import TestClient
    
    from .utils import needs_py310
    
    
    class Dep:
        def __call__(self, request: Request):
            return "test"
    
    
    @needs_py310
    def test_stringified_annotations():
        app = FastAPI()
    
        client = TestClient(app)
    
        @app.get("/test/")
        def call(test: Annotated[str, Depends(Dep())]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 545 bytes
    - Click Count (0)
  9. docs/de/docs/tutorial/dependencies/index.md

    /// info | Info
    
    FastAPI unterstützt (und empfiehlt die Verwendung von) `Annotated` seit Version 0.95.0.
    
    Wenn Sie eine ältere Version haben, werden Sie Fehler angezeigt bekommen, wenn Sie versuchen, `Annotated` zu verwenden.
    
    Bitte [aktualisieren Sie FastAPI](../../deployment/versions.md#upgrading-the-fastapi-versions) daher mindestens zu Version 0.95.1, bevor Sie `Annotated` verwenden.
    
    ///
    
    ### `Depends` importieren { #import-depends }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 17:58:09 GMT 2026
    - 11.3K bytes
    - Click Count (0)
  10. docs/pt/docs/tutorial/dependencies/index.md

    /// info | Informação
    
    FastAPI passou a suportar a notação `Annotated` (e começou a recomendá-la) na versão 0.95.0.
    
    Se você utiliza uma versão anterior, ocorrerão erros ao tentar utilizar `Annotated`.
    
    Certifique-se de [Atualizar a versão do FastAPI](../../deployment/versions.md#upgrading-the-fastapi-versions) para pelo menos 0.95.1 antes de usar `Annotated`.
    
    ///
    
    ### Importando `Depends` { #import-depends }
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Mar 19 18:20:43 GMT 2026
    - 10.6K bytes
    - Click Count (0)
Back to Top