Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for FieldInfo (0.26 sec)

  1. fastapi/_compat.py

        def is_bytes_sequence_field(field: ModelField) -> bool:
            return is_bytes_sequence_annotation(field.type_)
    
        def copy_field_info(*, field_info: FieldInfo, annotation: Any) -> FieldInfo:
            cls = type(field_info)
            merged_field_info = cls.from_annotation(annotation)
            new_field_info = copy(field_info)
            new_field_info.metadata = merged_field_info.metadata
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  2. docs/ko/docs/tutorial/body-fields.md

    !!! note "기술적 세부사항"
        실제로 `Query`, `Path`등, 여러분이 앞으로 볼 다른 것들은 공통 클래스인 `Param` 클래스의 서브클래스 객체를 만드는데, 그 자체로 Pydantic의 `FieldInfo` 클래스의 서브클래스입니다.
    
        그리고 Pydantic의 `Field` 또한 `FieldInfo`의 인스턴스를 반환합니다.
    
        `Body` 또한 `FieldInfo`의 서브클래스 객체를 직접적으로 반환합니다. 그리고 `Body` 클래스의 서브클래스인 것들도 여러분이 나중에 보게될 것입니다.
    
         `Query`, `Path`와 그 외 것들을 `fastapi`에서 임포트할 때, 이는 실제로 특별한 클래스를 반환하는 함수인 것을 기억해 주세요.
    
    !!! tip "팁"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  3. docs/zh/docs/tutorial/body-fields.md

        ```
    
    `Field` 的工作方式和 `Query`、`Path`、`Body` 相同,参数也相同。
    
    !!! note "技术细节"
    
        实际上,`Query`、`Path` 都是 `Params` 的子类,而 `Params` 类又是 Pydantic 中 `FieldInfo` 的子类。
    
        Pydantic 的 `Field` 返回也是 `FieldInfo` 的类实例。
    
        `Body` 直接返回的也是 `FieldInfo` 的子类的对象。后文还会介绍一些 `Body` 的子类。
    
        注意,从 `fastapi` 导入的 `Query`、`Path` 等对象实际上都是返回特殊类的函数。
    
    !!! tip "提示"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 01 05:35:27 GMT 2024
    - 3K bytes
    - Viewed (0)
  4. fastapi/utils.py

        field_info: Optional[FieldInfo] = None,
        alias: Optional[str] = None,
        mode: Literal["validation", "serialization"] = "validation",
    ) -> ModelField:
        """
        Create a new response field. Raises if type_ is invalid.
        """
        class_validators = class_validators or {}
        if PYDANTIC_V2:
            field_info = field_info or FieldInfo(
                annotation=type_, default=default, alias=alias
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  5. fastapi/dependencies/utils.py

                if isinstance(arg, (FieldInfo, params.Depends))
            ]
            fastapi_specific_annotations = [
                arg
                for arg in fastapi_annotations
                if isinstance(arg, (params.Param, params.Body, params.Depends))
            ]
            if fastapi_specific_annotations:
                fastapi_annotation: Union[
                    FieldInfo, params.Depends, None
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  6. fastapi/params.py

    from fastapi.openapi.models import Example
    from pydantic.fields import FieldInfo
    from typing_extensions import Annotated, deprecated
    
    from ._compat import PYDANTIC_V2, PYDANTIC_VERSION, Undefined
    
    _Unset: Any = Undefined
    
    
    class ParamTypes(Enum):
        query = "query"
        header = "header"
        path = "path"
        cookie = "cookie"
    
    
    class Param(FieldInfo):
        in_: ParamTypes
    
        def __init__(
            self,
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 27.5K bytes
    - Viewed (1)
Back to top