Skip to main content

MessageDecoder

Decode JSON that includes serialized Message instances.

Constructor

Signature

def MessageDecoder() - > null

Methods


process_messages()

@classmethod
def process_messages(
obj: any
) - > any

Recursively traverses a decoded JSON structure to identify and reconstruct Message instances from their serialized list format.

Parameters

NameTypeDescription
objanyThe decoded JSON object, list, or primitive value to be inspected for message signatures.

Returns

TypeDescription
anyThe processed object with serialized message lists replaced by Message instances and HTML content marked as safe where applicable.

decode()

@classmethod
def decode(
s: string,
**kwargs: dict
) - > any

Decodes a JSON string into Python objects and then processes the result to restore any serialized Message instances.

Parameters

NameTypeDescription
sstringThe JSON string to be decoded.
**kwargsdictAdditional keyword arguments passed to the underlying JSONDecoder.decode method.

Returns

TypeDescription
anyThe fully decoded Python object hierarchy with Message instances reconstructed.