Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 171 for bool (0.18 sec)

  1. tests/test_additional_properties_bool.py

    Sebastián Ramírez <******@****.***> 1688749933 +0200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  2. fastapi/dependencies/utils.py

                field_info=field_info,
            )
    
        return type_annotation, depends, field
    
    
    def is_body_param(*, param_field: ModelField, is_path_param: bool) -> bool:
        if is_path_param:
            assert is_scalar_field(
                field=param_field
            ), "Path params must be of one of the supported types"
            return False
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  3. tests/main.py

    @app.get("/path/int/{item_id}")
    def get_int_id(item_id: int):
        return item_id
    
    
    @app.get("/path/float/{item_id}")
    def get_float_id(item_id: float):
        return item_id
    
    
    @app.get("/path/bool/{item_id}")
    def get_bool_id(item_id: bool):
        return item_id
    
    
    @app.get("/path/param/{item_id}")
    def get_path_param_id(item_id: Optional[str] = Path()):
        return item_id
    
    
    @app.get("/path/param-minlength/{item_id}")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  4. fastapi/security/api_key.py

                    It will be included in the generated OpenAPI (e.g. visible at `/docs`).
                    """
                ),
            ] = None,
            auto_error: Annotated[
                bool,
                Doc(
                    """
                    By default, if the query parameter is not provided, `APIKeyQuery` will
                    automatically cancel the request and send the client an error.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 23 22:29:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  5. docs_src/python_types/tutorial005.py

    def get_items(item_a: str, item_b: int, item_c: float, item_d: bool, item_e: bytes):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 143 bytes
    - Viewed (0)
  6. docs_src/response_model/tutorial003_05_py310.py

    from fastapi import FastAPI, Response
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/portal", response_model=None)
    async def get_portal(teleport: bool = False) -> Response | dict:
        if teleport:
            return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 10 16:22:47 GMT 2023
    - 373 bytes
    - Viewed (0)
  7. docs_src/sql_databases/sql_app/schemas.py

        class Config:
            orm_mode = True
    
    
    class UserBase(BaseModel):
        email: str
    
    
    class UserCreate(UserBase):
        password: str
    
    
    class User(UserBase):
        id: int
        is_active: bool
        items: List[Item] = []
    
        class Config:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 502 bytes
    - Viewed (0)
  8. docs_src/additional_responses/tutorial004.py

    }
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
        response_model=Item,
        responses={**responses, 200: {"content": {"image/png": {}}}},
    )
    async def read_item(item_id: str, img: Union[bool, None] = None):
        if img:
            return FileResponse("image.png", media_type="image/png")
        else:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 701 bytes
    - Viewed (0)
  9. docs/ko/docs/tutorial/query-params.md

    !!! note "참고"
        FastAPI는 `q`가 `= None`이므로 선택적이라는 것을 인지합니다.
    
        `Union[str, None]`에 있는 `Union`은 FastAPI(FastAPI는 `str` 부분만 사용합니다)가 사용하는게 아니지만, `Union[str, None]`은 편집기에게 코드에서 오류를 찾아낼 수 있게 도와줍니다.
    
    ## 쿼리 매개변수 형변환
    
    `bool` 형으로 선언할 수도 있고, 아래처럼 변환됩니다:
    
    ```Python hl_lines="9"
    {!../../../docs_src/query_params/tutorial003.py!}
    ```
    
    이 경우, 아래로 이동하면:
    
    ```
    http://127.0.0.1:8000/items/foo?short=1
    ```
    
    또는
    
    ```
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  10. fastapi/openapi/utils.py

        schema_generator: GenerateJsonSchema,
        model_name_map: ModelNameMap,
        field_mapping: Dict[
            Tuple[ModelField, Literal["validation", "serialization"]], JsonSchemaValue
        ],
        separate_input_output_schemas: bool = True,
    ) -> List[Dict[str, Any]]:
        parameters = []
        for param in all_route_params:
            field_info = param.field_info
            field_info = cast(Param, field_info)
            if not field_info.include_in_schema:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
Back to top