- Sort Score
- Result 10 results
- Languages All
Results 61 - 68 of 68 for line_length (0.08 sec)
-
docs/zh/docs/tutorial/query-params-str-validations.md
然后,我们可以将更多的参数传递给 `Query`。在本例中,适用于字符串的 `max_length` 参数: ```Python q: Union[str, None] = Query(default=None, max_length=50) ``` 将会校验数据,在数据无效时展示清晰的错误信息,并在 OpenAPI 模式的*路径操作*中记录该参数。 ## 添加更多校验 你还可以添加 `min_length` 参数: ```Python hl_lines="10" {!../../docs_src/query_params_str_validations/tutorial003.py!} ``` ## 添加正则表达式 你可以定义一个参数值必须匹配的<abbr title="正则表达式或正则是定义字符串搜索模式的字符序列。">正则表达式</abbr>: ```Python hl_lines="11"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.2K bytes - Viewed (0) -
docs/ja/docs/tutorial/query-params-str-validations.md
```Python q: Union[str, None] = Query(default=None, max_length=50) ``` これにより、データを検証し、データが有効でない場合は明確なエラーを表示し、OpenAPIスキーマの *path operation* にパラメータを記載します。 ## バリデーションをさらに追加する パラメータ`min_length`も追加することができます: ```Python hl_lines="10" {!../../docs_src/query_params_str_validations/tutorial003.py!} ``` ## 正規表現の追加 パラメータが一致するべき<abbr title="正規表現とは、文字列の検索パターンを定義する文字列です。">正規表現</abbr>を定義することができます:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 10.5K bytes - Viewed (0) -
docs/ru/docs/tutorial/query-params-str-validations.md
``` Но у нас query-параметр определён как `Query`. Например: //// tab | Annotated ```Python q: Annotated[Union[str, None], Query(min_length=3)] = None ``` //// //// tab | без Annotated ```Python q: Union[str, None] = Query(default=None, min_length=3) ``` //// В таком случае, чтобы сделать query-параметр `Query` обязательным, вы можете просто не указывать значение по умолчанию:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 37.5K bytes - Viewed (0) -
docs/de/docs/tutorial/query-params-str-validations.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 27.2K bytes - Viewed (0) -
tests/test_path.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 34.4K bytes - Viewed (0) -
compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java
Registered: Sun Nov 03 03:35:11 UTC 2024 - Last Modified: Fri Oct 25 12:31:46 UTC 2024 - 26K bytes - Viewed (0) -
fastapi/openapi/models.py
contact: Optional[Contact] = None license: Optional[License] = None version: str class ServerVariable(BaseModelWithConfig): enum: Annotated[Optional[List[str]], Field(min_length=1)] = None default: str description: Optional[str] = None class Server(BaseModelWithConfig): url: Union[AnyUrl, str] description: Optional[str] = None
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 22:49:33 UTC 2024 - 15K bytes - Viewed (0) -
docs/en/docs/release-notes.md
app = FastAPI() @app.get("/items/{item_id}") def main( item_id: int = Path(default=..., gt=0), query: str = Query(default=..., max_length=10), session: str = Cookie(default=..., min_length=3), x_trace: str = Header(default=..., title="Tracing header"), ): return {"message": "Hello World"} ``` ...all these parameters are required because the default value is `...` (Ellipsis).
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Nov 01 11:25:57 UTC 2024 - 460.3K bytes - Viewed (0)