Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 199 for tutorial003 (0.06 sec)

  1. docs/zh/docs/tutorial/path-operation-configuration.md

    {* ../../docs_src/path_operation_configuration/tutorial002.py hl[17,22,27] *}
    
    OpenAPI 概图会自动添加标签,供 API 文档接口使用:
    
    <img src="/img/tutorial/path-operation-configuration/image01.png">
    
    ## `summary` 和 `description` 参数
    
    路径装饰器还支持 `summary` 和 `description` 这两个参数:
    
    {* ../../docs_src/path_operation_configuration/tutorial003.py hl[20:21] *}
    
    ## 文档字符串(`docstring`)
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/events.md

    首先要注意的是,我们定义了一个带有 `yield` 的异步函数。这与带有 `yield` 的依赖项非常相似。
    
    ```Python hl_lines="14-19"
    {!../../docs_src/events/tutorial003.py!}
    ```
    
    这个函数在 `yield`之前的部分,会在应用启动前执行。
    
    剩下的部分在 `yield` 之后,会在应用完成后执行。
    
    ## 异步上下文管理器
    
    如你所见,这个函数有一个装饰器 `@asynccontextmanager` 。
    
    它将函数转化为所谓的“**异步上下文管理器**”。
    
    ```Python hl_lines="1  13"
    {!../../docs_src/events/tutorial003.py!}
    ```
    
    在 Python 中,  **上下文管理器**是一个你可以在 `with` 语句中使用的东西,例如,`open()` 可以作为上下文管理器使用。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 7K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py

    import pytest
    from dirty_equals import IsList
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    DESCRIPTIONS = {
        "tutorial003": "Create an item with all the information, name, description, price, tax and a set of unique tags",
        "tutorial004": dedent("""
            Create an item with all the information:
    
            - **name**: each item must have a name
            - **description**: a long description
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7K bytes
    - Viewed (0)
  4. docs/ko/docs/tutorial/query-params.md

    매개변수들은 이름으로 감지됩니다:
    
    {* ../../docs_src/query_params/tutorial004.py hl[8,10] *}
    
    ## 필수 쿼리 매개변수
    
    경로가 아닌 매개변수에 대한 기본값을 선언할 때(지금은 쿼리 매개변수만 보았습니다), 해당 매개변수는 필수적(Required)이지 않았습니다.
    
    특정값을 추가하지 않고 선택적으로 만들기 위해선 기본값을 `None`으로 설정하면 됩니다.
    
    그러나 쿼리 매개변수를 필수로 만들려면 단순히 기본값을 선언하지 않으면 됩니다:
    
    {* ../../docs_src/query_params/tutorial005.py hl[6:7] *}
    
    여기 쿼리 매개변수 `needy`는 `str`형인 필수 쿼리 매개변수입니다.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/path-operation-configuration.md

    {* ../../docs_src/path_operation_configuration/tutorial002.py hl[17,22,27] *}
    
    전달된 태그들은 OpenAPI의 스키마에 추가되며, 자동 문서 인터페이스에서 사용됩니다:
    
    <img src="/img/tutorial/path-operation-configuration/image01.png">
    
    ## 요약과 기술
    
    `summary`와 `description`을 추가할 수 있습니다:
    
    {* ../../docs_src/path_operation_configuration/tutorial003.py hl[20:21] *}
    
    ## 독스트링으로 만든 기술
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/schema-extra-example.md

    {* ../../docs_src/schema_extra_example/tutorial001.py hl[15,16,17,18,19,20,21,22,23] *}
    
    その追加情報はそのまま出力され、JSON Schemaに追加されます。
    
    ## `Field`の追加引数
    
    後述する`Field`、`Path`、`Query`、`Body`などでは、任意の引数を関数に渡すことでJSON Schemaの追加情報を宣言することもできます:
    
    {* ../../docs_src/schema_extra_example/tutorial002.py hl[4,10,11,12,13] *}
    
    /// warning | 注意
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  7. docs/uk/docs/tutorial/metadata.md

        * Ви можете вимкнути його, встановивши `redoc_url=None`.
    
    Наприклад, щоб налаштувати Swagger UI на `/documentation` і вимкнути ReDoc:
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Mar 19 17:09:57 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  8. docs/ko/docs/advanced/events.md

    {* ../../docs_src/events/tutorial003.py hl[14:19] *}
    
    함수의 첫 번째 부분, 즉 `yield` 이전의 코드는 애플리케이션이 시작되기 **전에** 실행됩니다.
    
    그리고 `yield` 이후의 부분은 애플리케이션이 완료된 후 **나중에** 실행됩니다.
    
    ### 비동기 컨텍스트 매니저
    
    함수를 확인해보면, `@asynccontextmanager`로 장식되어 있습니다.
    
    이것은 함수를 "**비동기 컨텍스트 매니저**"라고 불리는 것으로 변환시킵니다.
    
    {* ../../docs_src/events/tutorial003.py hl[1,13] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 9.2K bytes
    - Viewed (0)
  9. docs/zh/docs/advanced/dataclasses.md

    本例把标准的 `dataclasses` 直接替换为 `pydantic.dataclasses`:
    
    ```{ .python .annotate hl_lines="1  5  8-11  14-17  23-25  28" }
    {!../../docs_src/dataclasses_/tutorial003.py!}
    ```
    
    1. 本例依然要从标准的 `dataclasses` 中导入 `field`;
    
    2. 使用 `pydantic.dataclasses` 直接替换 `dataclasses`;
    
    3. `Author` 数据类包含 `Item` 数据类列表;
    
    4. `Author` 数据类用于 `response_model` 参数;
    
    5. 其它带有数据类的标准类型注解也可以作为请求体;
    
        本例使用的是 `Item` 数据类列表;
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 3.7K bytes
    - Viewed (0)
  10. docs/ko/docs/tutorial/header-params.md

    ## `Header` 임포트
    
    먼저 `Header`를 임포트합니다:
    
    {* ../../docs_src/header_params/tutorial001.py hl[3] *}
    
    ## `Header` 매개변수 선언
    
    `Path`, `Query` 그리고 `Cookie`를 사용한 동일한 구조를 이용하여 헤더 매개변수를 선언합니다.
    
    첫 번째 값은 기본값이며, 추가 검증이나 어노테이션 매개변수 모두 전달할 수 있습니다:
    
    {* ../../docs_src/header_params/tutorial001.py hl[9] *}
    
    /// note | 기술 세부사항
    
    `Header`는 `Path`, `Query` 및 `Cookie`의 "자매"클래스입니다. 이 역시 동일한 공통 `Param` 클래스를 상속합니다.
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 3.3K bytes
    - Viewed (0)
Back to top