(value: object, field: FieldInfo, key: str)
| 493 | |
| 494 | |
| 495 | def _construct_field(value: object, field: FieldInfo, key: str) -> object: |
| 496 | if value is None: |
| 497 | return field_get_default(field) |
| 498 | |
| 499 | if PYDANTIC_V1: |
| 500 | type_ = cast(type, field.outer_type_) # type: ignore |
| 501 | else: |
| 502 | type_ = field.annotation # type: ignore |
| 503 | |
| 504 | if type_ is None: |
| 505 | raise RuntimeError(f"Unexpected field type is None for {key}") |
| 506 | |
| 507 | return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) |
| 508 | |
| 509 | |
| 510 | def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: |
no test coverage detected