Get field list of a model.
(model: type[BaseModel])
| 225 | return self.type_adapter.validate_python(value) |
| 226 | |
| 227 | def model_fields(model: type[BaseModel]) -> list[ModelField]: |
| 228 | """Get field list of a model.""" |
| 229 | |
| 230 | return [ |
| 231 | ModelField._construct( |
| 232 | name=name, |
| 233 | annotation=field_info.rebuild_annotation(), |
| 234 | field_info=FieldInfo._inherit_construct(field_info), |
| 235 | ) |
| 236 | for name, field_info in model.model_fields.items() |
| 237 | ] |
| 238 | |
| 239 | def model_config(model: type[BaseModel]) -> Any: |
| 240 | """Get config of a model.""" |
no test coverage detected