Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 83 for min_length (0.04 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. fastapi/params.py

                alias=alias,
                title=title,
                description=description,
                gt=gt,
                ge=ge,
                lt=lt,
                le=le,
                min_length=min_length,
                max_length=max_length,
                discriminator=discriminator,
                multiple_of=multiple_of,
                allow_inf_nan=allow_inf_nan,
                max_digits=max_digits,
                decimal_places=decimal_places,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 26.3K bytes
    - Click Count (0)
  2. fastapi/param_functions.py

            serialization_alias=serialization_alias,
            title=title,
            description=description,
            gt=gt,
            ge=ge,
            lt=lt,
            le=le,
            min_length=min_length,
            max_length=max_length,
            pattern=pattern,
            regex=regex,
            discriminator=discriminator,
            strict=strict,
            multiple_of=multiple_of,
            allow_inf_nan=allow_inf_nan,
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 12:54:56 GMT 2025
    - 63K bytes
    - Click Count (0)
  3. tests/main.py

    
    @app.get("/path/param-minlength/{item_id}")
    def get_path_param_min_length(item_id: str = Path(min_length=3)):
        return item_id
    
    
    @app.get("/path/param-maxlength/{item_id}")
    def get_path_param_max_length(item_id: str = Path(max_length=3)):
        return item_id
    
    
    @app.get("/path/param-min_maxlength/{item_id}")
    def get_path_param_min_max_length(item_id: str = Path(max_length=3, min_length=2)):
        return item_id
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 4.5K bytes
    - Click Count (0)
  4. tests/test_annotated.py

    async def default(foo: Annotated[str, Query()] = "foo"):
        return {"foo": foo}
    
    
    @app.get("/required")
    async def required(foo: Annotated[str, Query(min_length=1)]):
        return {"foo": foo}
    
    
    @app.get("/multiple")
    async def multiple(foo: Annotated[str, object(), Query(min_length=1)]):
        return {"foo": foo}
    
    
    @app.get("/unrelated")
    async def unrelated(foo: Annotated[str, object()]):
        return {"foo": foo}
    
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Dec 27 18:19:10 GMT 2025
    - 9.6K bytes
    - Click Count (0)
  5. docs_src/query_params_str_validations/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Union[str, None] = Query(
            default=None, min_length=3, max_length=50, pattern="^fixedquery$"
        ),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 367 bytes
    - Click Count (0)
  6. docs_src/query_params_str_validations/tutorial003_py39.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Union[str, None] = Query(default=None, min_length=3, max_length=50),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 329 bytes
    - Click Count (0)
  7. docs_src/query_params_str_validations/tutorial003_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[str | None, Query(min_length=3, max_length=50)] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 330 bytes
    - Click Count (0)
  8. docs_src/query_params_str_validations/tutorial004_an_py310.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[
            str | None, Query(min_length=3, max_length=50, pattern="^fixedquery$")
        ] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 368 bytes
    - Click Count (0)
  9. docs_src/query_params_str_validations/tutorial010_py310.py

            default=None,
            alias="item-query",
            title="Query string",
            description="Query string for the items to search in the database that have a good match",
            min_length=3,
            max_length=50,
            pattern="^fixedquery$",
            deprecated=True,
        ),
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 542 bytes
    - Click Count (0)
  10. docs/ko/docs/tutorial/query-params-str-validations.md

    `Optional` 부분은 편집기에게 더 나은 지원을 제공하기 위해서만 사용됩니다.
    
    ///
    
    또한 `Query`로 더 많은 매개변수를 전달할 수 있습니다. 지금의 경우 문자열에 적용되는 `max_length` 매개변수입니다:
    
    ```Python
    q: str = Query(None, max_length=50)
    ```
    
    이는 데이터를 검증할 것이고, 데이터가 유효하지 않다면 명백한 오류를 보여주며, OpenAPI 스키마 *경로 작동*에 매개변수를 문서화 합니다.
    
    ## 검증 추가
    
    매개변수 `min_length` 또한 추가할 수 있습니다:
    
    {* ../../docs_src/query_params_str_validations/tutorial003.py hl[9] *}
    
    ## 정규식 추가
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 9.2K bytes
    - Click Count (0)
Back to Top