Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for field_info (0.12 sec)

  1. fastapi/_compat/v2.py

    # TODO: remove when dropping support for Pydantic < v2.12.3
    def asdict(field_info: FieldInfo) -> dict[str, Any]:
        attributes = {}
        for attr in _Attrs:
            value = getattr(field_info, attr, Undefined)
            if value is not Undefined:
                attributes[attr] = value
        return {
            "annotation": field_info.annotation,
            "metadata": field_info.metadata,
            "attributes": attributes,
        }
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 19.1K bytes
    - Viewed (0)
  2. tests/test_compat.py

    from pydantic import BaseModel, ConfigDict
    from pydantic.fields import FieldInfo
    
    from .utils import needs_py310
    
    
    def test_model_field_default_required():
        from fastapi._compat import v2
    
        # For coverage
        field_info = FieldInfo(annotation=str)
        field = v2.ModelField(name="foo", field_info=field_info)
        assert field.default is Undefined
    
    
    def test_complex():
        app = FastAPI()
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  3. fastapi/dependencies/utils.py

                field_info = params.Body(annotation=use_annotation, default=default_value)
            else:
                field_info = params.Query(annotation=use_annotation, default=default_value)
    
        field = None
        # It's a field_info, not a dependency
        if field_info is not None:
            # Handle field_info.in_
            if is_path_param:
                assert isinstance(field_info, params.Path), (
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 37.6K bytes
    - Viewed (3)
  4. fastapi/openapi/utils.py

                default_convert_underscores = getattr(
                    first_field.field_info, "convert_underscores", True
                )
        for param_type, param_group in parameter_groups:
            for param in param_group:
                field_info = param.field_info
                # field_info = cast(Param, field_info)
                if not getattr(field_info, "include_in_schema", True):
                    continue
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 23.2K bytes
    - Viewed (0)
  5. fastapi/utils.py

                f" Please update the response model {type_!r}."
            )
        class_validators = class_validators or {}
    
        field_info = field_info or FieldInfo(annotation=type_, default=default, alias=alias)
        kwargs = {"mode": mode, "name": name, "field_info": field_info}
        try:
            return v2.ModelField(**kwargs)  # type: ignore[return-value,arg-type]
        except PydanticSchemaGenerationError:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  6. fastapi/routing.py

        assert dependant.call is not None, "dependant.call must be a function"
        is_coroutine = dependant.is_coroutine_callable
        is_body_form = body_field and isinstance(body_field.field_info, params.Form)
        if isinstance(response_class, DefaultPlaceholder):
            actual_response_class: type[Response] = response_class.value
        else:
            actual_response_class = response_class
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 174.6K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/body-fields.md

    И `Field` (из Pydantic) также возвращает экземпляр `FieldInfo`.
    
    `Body` также напрямую возвращает объекты подкласса `FieldInfo`. И есть и другие, с которыми вы познакомитесь позже, которые являются подклассами класса `Body`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Tue Sep 30 11:24:39 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/body-fields.md

    Actually, `Query`, `Path` and others you'll see next create objects of subclasses of a common `Param` class, which is itself a subclass of Pydantic's `FieldInfo` class.
    
    And Pydantic's `Field` returns an instance of `FieldInfo` as well.
    
    `Body` also returns objects of a subclass of `FieldInfo` directly. And there are others you will see later that are subclasses of the `Body` class.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  9. docs/pt/docs/tutorial/body-fields.md

    Na realidade, `Query`, `Path` e outros que você verá em seguida, criam objetos de subclasses de uma classe `Param` comum, que é ela mesma uma subclasse da classe `FieldInfo` do Pydantic.
    
    E `Field` do Pydantic retorna uma instância de `FieldInfo` também.
    
    `Body` também retorna objetos de uma subclasse de `FieldInfo` diretamente. E tem outras que você verá mais tarde que são subclasses da classe `Body`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  10. docs/de/docs/tutorial/body-fields.md

    Und Pydantics `Field` gibt ebenfalls eine Instanz von `FieldInfo` zurück.
    
    `Body` gibt auch direkt Instanzen einer Unterklasse von `FieldInfo` zurück. Später werden Sie andere sehen, die Unterklassen der `Body`-Klasse sind.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Sep 20 15:10:09 UTC 2025
    - 2.7K bytes
    - Viewed (0)
Back to top