Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 68 of 68 for line_length (0.07 sec)

  1. 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)
  2. 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)
  3. 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)
  4. docs/de/docs/tutorial/query-params-str-validations.md

    Aber jetzt deklarieren wir den Parameter mit `Query`, wie in:
    
    //// tab | Annotiert
    
    ```Python
    q: Annotated[Union[str, None], Query(min_length=3)] = None
    ```
    
    ////
    
    //// tab | Nicht annotiert
    
    ```Python
    q: Union[str, None] = Query(default=None, min_length=3)
    ```
    
    ////
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  5. tests/test_path.py

                        "input": "f",
                        "ctx": {"min_length": 2},
                    }
                ]
            }
        ) | IsDict(
            {
                "detail": [
                    {
                        "loc": ["path", "item_id"],
                        "msg": "ensure this value has at least 2 characters",
                        "type": "value_error.any_str.min_length",
                        "ctx": {"limit_value": 2},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 34.4K bytes
    - Viewed (0)
  6. compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java

        }
    
        @Override
        public int hashCode() {
            return items.hashCode();
        }
    
        // CHECKSTYLE_OFF: LineLength
    
        /**
         * Main to test version parsing and comparison.
         * <p>
         * To check how "1.2.7" compares to "1.2-SNAPSHOT", for example, you can issue
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 26K bytes
    - Viewed (0)
  7. 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)
  8. 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)
Back to top