Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 139 for union (0.15 sec)

  1. docs/ru/docs/index.md

    ### Создание
    
    * Создайте файл `main.py` со следующим содержимым:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 25.8K bytes
    - Viewed (0)
  2. docs/de/docs/tutorial/query-params-str-validations.md

    ```Python
    q: str
    ```
    
    statt:
    
    ```Python
    q: Union[str, None] = None
    ```
    
    Aber jetzt deklarieren wir den Parameter mit `Query`, wie in:
    
    === "Annotiert"
    
        ```Python
        q: Annotated[Union[str, None], Query(min_length=3)] = None
        ```
    
    === "Nicht annotiert"
    
        ```Python
        q: Union[str, None] = Query(default=None, min_length=3)
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 17:58:59 GMT 2024
    - 27.7K bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/query-params.md

    !!! check "확인"
        **FastAPI**는 `item_id`가 경로 매개변수이고 `q`는 경로 매개변수가 아닌 쿼리 매개변수라는 것을 알 정도로 충분히 똑똑합니다.
    
    !!! note "참고"
        FastAPI는 `q`가 `= None`이므로 선택적이라는 것을 인지합니다.
    
        `Union[str, None]`에 있는 `Union`은 FastAPI(FastAPI는 `str` 부분만 사용합니다)가 사용하는게 아니지만, `Union[str, None]`은 편집기에게 코드에서 오류를 찾아낼 수 있게 도와줍니다.
    
    ## 쿼리 매개변수 형변환
    
    `bool` 형으로 선언할 수도 있고, 아래처럼 변환됩니다:
    
    ```Python hl_lines="9"
    {!../../../docs_src/query_params/tutorial003.py!}
    ```
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  4. docs/es/docs/tutorial/query-params.md

    !!! note "Nota"
        FastAPI sabrá que `q` es opcional por el `= None`.
    
        El `Union` en `Union[str, None]` no es usado por FastAPI (FastAPI solo usará la parte `str`), pero el `Union[str, None]` le permitirá a tu editor ayudarte a encontrar errores en tu código.
    
    ## Conversión de tipos de parámetros de query
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/query-params-str-validations.md

        ```
    
    The query parameter `q` is of type `Union[str, None]` (or `str | None` in Python 3.10), that means that it's of type `str` but could also be `None`, and indeed, the default value is `None`, so FastAPI will know it's not required.
    
    !!! note
        FastAPI will know that the value of `q` is not required because of the default value `= None`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 25.7K bytes
    - Viewed (0)
  6. docs/zh/docs/index.md

    </div>
    
    ## 示例
    
    ### 创建
    
    * 创建一个 `main.py` 文件并写入以下内容:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 18.2K bytes
    - Viewed (0)
  7. fastapi/routing.py

            status_code: Optional[int] = None,
            tags: Optional[List[Union[str, Enum]]] = None,
            dependencies: Optional[Sequence[params.Depends]] = None,
            summary: Optional[str] = None,
            description: Optional[str] = None,
            response_description: str = "Successful Response",
            responses: Optional[Dict[Union[int, str], Dict[str, Any]]] = None,
            deprecated: Optional[bool] = None,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  8. docs/tr/docs/index.md

    * `main.py` adında bir dosya oluşturup içine şu kodu yapıştıralım:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 21.9K bytes
    - Viewed (0)
  9. docs/uk/docs/index.md

    ## Приклад
    
    ### Створіть
    
    * Створіть файл `main.py` з:
    
    ```Python
    from typing import Union
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    <details markdown="1">
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 24.2K bytes
    - Viewed (0)
  10. docs/zh/docs/tutorial/query-params-str-validations.md

    ```
    
    由于我们必须用 `Query(default=None)` 替换默认值 `None`,`Query` 的第一个参数同样也是用于定义默认值。
    
    所以:
    
    ```Python
    q: Union[str, None] = Query(default=None)
    ```
    
    ...使得参数可选,等同于:
    
    ```Python
    q: str = None
    ```
    
    但是 `Query` 显式地将其声明为查询参数。
    
    然后,我们可以将更多的参数传递给 `Query`。在本例中,适用于字符串的 `max_length` 参数:
    
    ```Python
    q: Union[str, None] = Query(default=None, max_length=50)
    ```
    
    将会校验数据,在数据无效时展示清晰的错误信息,并在 OpenAPI 模式的*路径操作*中记录该参​​数。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.2K bytes
    - Viewed (0)
Back to top