def _register_json_primitive(object_type, encoder, decoder):
global _TYPE_TO_ENCODER<EOL>global _TYPE_NAME_TO_DECODER<EOL>if object_type not in _TYPE_TO_ENCODER:<EOL><INDENT>_TYPE_TO_ENCODER[object_type] = encoder<EOL>_TYPE_NAME_TO_DECODER[object_type.__name__] = decoder<EOL><DEDENT>
Extend what Pipeline can serialize.

    Args:
      object_type: type of the object.
      encoder: a function that takes in an object and returns
        a dict of json primitives.
      decoder: inverse function of encoder.