openpectus.aggregator.routers.serialization

Attributes

namespace_name

namespace_types

Functions

serialize(msg)

Serialize a dto message in a round-trippable fashion.

deserialize(json_dict)

Deserializes a dto message to the proper concrete BaseModel subtype.

try_get_ctor_from_namespace(type_name, namespace)

Module Contents

openpectus.aggregator.routers.serialization.namespace_name = 'openpectus.aggregator.routers.dto'
openpectus.aggregator.routers.serialization.namespace_types
openpectus.aggregator.routers.serialization.serialize(msg)

Serialize a dto message in a round-trippable fashion.

Parameters:

msg (pydantic.BaseModel)

Return type:

dict[str, Any]

openpectus.aggregator.routers.serialization.deserialize(json_dict)

Deserializes a dto message to the proper concrete BaseModel subtype.

Supports messages serialized to dict by the serialize() function.

Parameters:

json_dict (dict[str, Any])

Return type:

pydantic.BaseModel

openpectus.aggregator.routers.serialization.try_get_ctor_from_namespace(type_name, namespace)
Parameters:

type_name (str)