Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 128 for length (0.2 sec)

  1. docs/en/docs/js/custom.js

    }
    
    async function getData() {
        let page = 1
        let data = []
        let dataBatch = await getDataBatch(page)
        data = data.concat(dataBatch.items)
        const totalCount = dataBatch.total_count
        while (data.length < totalCount) {
            page += 1
            dataBatch = await getDataBatch(page)
            data = data.concat(dataBatch.items)
        }
        return data
    }
    
    function setupTermynal() {
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 08 17:50:56 GMT 2021
    - 6.6K bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial010_an_py39.py

            Query(
                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,
            ),
        ] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 635 bytes
    - Viewed (0)
  3. docs/ko/docs/tutorial/query-params-str-validations.md

        `Optional` 부분은 편집기에게 더 나은 지원을 제공하기 위해서만 사용됩니다.
    
    또한 `Query`로 더 많은 매개변수를 전달할 수 있습니다. 지금의 경우 문자열에 적용되는 `max_length` 매개변수입니다:
    
    ```Python
    q: str = Query(None, max_length=50)
    ```
    
    이는 데이터를 검증할 것이고, 데이터가 유효하지 않다면 명백한 오류를 보여주며, OpenAPI 스키마 *경로 작동*에 매개변수를 문서화 합니다.
    
    ## 검증 추가
    
    매개변수 `min_length` 또한 추가할 수 있습니다:
    
    ```Python hl_lines="9"
    {!../../../docs_src/query_params_str_validations/tutorial003.py!}
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Feb 11 13:48:31 GMT 2024
    - 9.6K bytes
    - Viewed (0)
  4. docs_src/query_params_str_validations/tutorial004_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[
            Union[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})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 381 bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/query-params-str-validations.md

    But now, having `Query(max_length=50)` inside of `Annotated`, we are telling FastAPI that we want it to extract this value from the query parameters (this would have been the default anyway 🤷) and that we want to have **additional validation** for this value (that's why we do this, to get the additional validation). 😎
    
    FastAPI will now:
    
    * **Validate** the data making sure that the max length is 50 characters
    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_src/query_params_str_validations/tutorial010_an_py310.py

            Query(
                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,
            ),
        ] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 622 bytes
    - Viewed (0)
  7. docs_src/query_params_str_validations/tutorial005_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)] = "fixedquery"):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 309 bytes
    - Viewed (0)
  8. docs_src/query_params_str_validations/tutorial007_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 350 bytes
    - Viewed (0)
  9. docs_src/query_params_str_validations/tutorial008_an_py310.py

    async def read_items(
        q: Annotated[
            str | None,
            Query(
                title="Query string",
                description="Query string for the items to search in the database that have a good match",
                min_length=3,
            ),
        ] = None,
    ):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 498 bytes
    - Viewed (0)
  10. docs_src/body_fields/tutorial001_py310.py

    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = Field(
            default=None, title="The description of the item", max_length=300
        )
        price: float = Field(gt=0, description="The price must be greater than zero")
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 523 bytes
    - Viewed (0)
Back to top