(value: object, field: FieldInfo, key: str)
| 360 | |
| 361 | |
| 362 | def _construct_field(value: object, field: FieldInfo, key: str) -> object: |
| 363 | if value is None: |
| 364 | return field_get_default(field) |
| 365 | |
| 366 | if PYDANTIC_V2: |
| 367 | type_ = field.annotation |
| 368 | else: |
| 369 | type_ = cast(type, field.outer_type_) # type: ignore |
| 370 | |
| 371 | if type_ is None: |
| 372 | raise RuntimeError(f"Unexpected field type is None for {key}") |
| 373 | |
| 374 | return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) |
| 375 | |
| 376 | |
| 377 | def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: |
no test coverage detected