- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for union (0.13 sec)
-
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) -
docs/em/docs/tutorial/query-params-str-validations.md
{!> ../../../docs_src/query_params_str_validations/tutorial001_py310.py!} ``` 🔢 🔢 `q` 🆎 `Union[str, None]` (⚖️ `str | None` 🐍 3️⃣.1️⃣0️⃣), 👈 ⛓ 👈 ⚫️ 🆎 `str` ✋️ 💪 `None`, & 👐, 🔢 💲 `None`, FastAPI 🔜 💭 ⚫️ 🚫 ✔. !!! note FastAPI 🔜 💭 👈 💲 `q` 🚫 ✔ ↩️ 🔢 💲 `= None`. `Union` `Union[str, None]` 🔜 ✔ 👆 👨🎨 🤝 👆 👍 🐕🦺 & 🔍 ❌. ## 🌖 🔬
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 11.9K bytes - Viewed (0) -
docs/ru/docs/tutorial/query-params-str-validations.md
```Python q: str ``` вместо: ```Python q: Union[str, None] = None ``` Но у нас query-параметр определён как `Query`. Например: === "Annotated" ```Python q: Annotated[Union[str, None], Query(min_length=3)] = None ``` === "без Annotated" ```Python q: Union[str, None] = Query(default=None, min_length=3) ```
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 38K bytes - Viewed (0) -
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) -
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)