(value: object, field: FieldInfo, key: str)
| 503 | |
| 504 | |
| 505 | def _construct_field(value: object, field: FieldInfo, key: str) -> object: |
| 506 | if value is None: |
| 507 | return field_get_default(field) |
| 508 | |
| 509 | if PYDANTIC_V1: |
| 510 | type_ = cast(type, field.outer_type_) # type: ignore |
| 511 | else: |
| 512 | type_ = field.annotation # type: ignore |
| 513 | |
| 514 | if type_ is None: |
| 515 | raise RuntimeError(f"Unexpected field type is None for {key}") |
| 516 | |
| 517 | return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) |
| 518 | |
| 519 | |
| 520 | def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: |
no test coverage detected