call_pydantic_serializer
No overview available.
def call_pydantic_serializer(
instance: BaseModel,
include_defaults: bool = True
) - > dict
Serializes a Pydantic model instance into a dictionary or JSON-compatible format. This function is used to convert complex data structures into primitive types for API responses or storage.
Parameters
| Name | Type | Description |
|---|---|---|
| instance | BaseModel | The Pydantic model instance to be serialized into a dictionary. |
| include_defaults | bool = True | Whether to include fields that have their default values in the output. |
Returns
| Type | Description |
|---|---|
dict | A dictionary representation of the model instance containing only serialized data types. |