get_pydantic_serializer
No overview available.
def get_pydantic_serializer(
model_class: Type[BaseModel]
) - > Callable
Returns a Pydantic-based serializer function for a given model class, enabling efficient conversion of model instances into dictionaries.
Parameters
| Name | Type | Description |
|---|---|---|
| model_class | Type[BaseModel] | The Pydantic model class used to define the structure and validation rules for the serialization process. |
Returns
| Type | Description |
|---|---|
Callable | A function that accepts a model instance and returns its dictionary representation based on the model's schema. |