MessageEncoder
Compactly serialize instances of the Message class as JSON.
Attributes
| Attribute | Type | Description |
|---|---|---|
| message_key | string = __json_message | A unique string identifier used as the first element in the serialized list to distinguish Message objects from other data types during JSON decoding. |
Constructor
Signature
def MessageEncoder() - > null
Methods
default()
@classmethod
def default(
obj: any
) - > list|any
Compactly serialize instances of the Message class as JSON.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | any | The object instance to be serialized into a JSON-compatible format. |
Returns
| Type | Description |
|---|---|
| `list | any` |