Skip to main content

register_serializer

Register a new serializer.

``serializer_module`` should be the fully qualified module name
for the serializer.

If ``serializers`` is provided, the registration will be added
to the provided dictionary.

If ``serializers`` is not provided, the registration will be made
directly into the global register of serializers. Adding serializers
directly is not a thread-safe operation.
def register_serializer(
format: string,
serializer_module: string,
serializers: dict = null
) - > null

Register a new serializer.

Parameters

NameTypeDescription
formatstringThe name of the serialization format (e.g., 'json', 'xml') to associate with the module.
serializer_modulestringThe fully qualified module name for the serializer that will be imported.
serializersdict = nullAn optional dictionary to store the registration; if omitted, the serializer is added to the global register (which is not thread-safe).

Returns

TypeDescription
nullNothing is returned; the serializer is registered by updating a dictionary in-place.