JsonMessageCodec.encode

JsonMessageCodec.encode(message)[source]

Encode a message to JSON string.

Parameters:
messageMessage or dict or object

Message to encode. Can be a Message instance, a dict, or an object implementing the COMPAS data framework.

Returns:
str

JSON string representation of the message.