class_docstr: A kernel spec model object.
docstr: Serialise this kernelspec to a JSON object.
  
  Returns a string.
docstr_tok: ["Serialise","this","kernelspec","to","a","JSON","object",".","Returns","a","string","."]
code: def to_json(self) -> str:
      """Serialise this kernelspec to a JSON object.
  
      Returns a string.
      """
      return json.dumps(self.to_dict())
  
imports: from __future__ import annotations
  import json
  import os
  import re
  import shutil
  import typing
  import warnings
  from jupyter_core.paths import SYSTEM_JUPYTER_PATH, jupyter_data_dir, jupyter_path
  from traitlets import Bool, CaselessStrEnum, Dict, HasTraits, List, Set, Type, Unicode, observe
  from traitlets.config import LoggingConfigurable
  from .provisioning import KernelProvisionerFactory
label_desc: Use image node_id 3 for calling the KernelSpec obj's underlying member method code with example usage: obj.to_json() and returns: json