docs: def register_class_for_json(
          cls: ClassType,
          method: str = METHOD_SIMPLE,
          obj_to_dict_fn: InstanceToDictFnType = None,
          dict_to_obj_fn: DictToInstanceFnType = initdict_to_instance,
          default_factory: DefaultFactoryFnType = None) -> None:
      """
      Registers the class cls for JSON serialization.
  
      - If both ``obj_to_dict_fn`` and dict_to_obj_fn are registered, the
        framework uses these to convert instances of the class to/from Python
        dictionaries, which are in turn serialized to JSON.
  
      - Otherwise:
  
        .. code-block:: python
  
          if method == 'simple':
              # ... uses simple_to_dict and simple_from_dict (q.v.)
  
          if method == 'strip_underscore':
              # ... uses strip_underscore_to_dict and simple_from_dict (q.v.)
      """
      typename = cls.__qualname__  # preferable to __name__
      # ... __name__ looks like "Thing" and is ambiguous
      # ... __qualname__ looks like "my.module.Thing" and is not
      if obj_to_dict_fn and dict_to_obj_fn:
          descriptor = JsonDescriptor(
              typename=typename,
              obj_to_dict_fn=obj_to_dict_fn,
              dict_to_obj_fn=dict_to_obj_fn,
              cls=cls,
              default_factory=default_factory)
      elif method == METHOD_SIMPLE:
          descriptor = JsonDescriptor(
              typename=typename,
              obj_to_dict_fn=instance_to_initdict_simple,
              dict_to_obj_fn=initdict_to_instance,
              cls=cls,
              default_factory=default_factory)
      elif method == METHOD_STRIP_UNDERSCORE:
          descriptor = JsonDescriptor(
              typename=typename,
              obj_to_dict_fn=instance_to_initdict_stripping_underscores,
              dict_to_obj_fn=initdict_to_instance,
              cls=cls,
              default_factory=default_factory)
      else:
          raise ValueError("Unknown method, and functions not fully specified")
      global TYPE_MAP
      TYPE_MAP[typename] = descriptor