Skip to main content

MessageEncoder

Compactly serialize instances of the Message class as JSON.

Attributes

AttributeTypeDescription
message_keystring = __json_messageA 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

NameTypeDescription
objanyThe object instance to be serialized into a JSON-compatible format.

Returns

TypeDescription
`listany`