code: def register_serialization_method(self, name, serialize_func):
          
          if name in self._default_serialization_methods:
              raise ValueError("Can't replace original %s serialization method")
          self._serialization_methods[name] = serialize_func
docs: Register a custom serialization method that can be
          used via schema configuration