def to_json_string(self) -> Text:
    """Serializes this instance to a JSON string."""
    try:
      return json.dumps(self.to_dict(), indent=2, sort_keys=True)
    except TypeError:
      e_str = traceback.format_exc()
      raise TypeError(
          "Could not JSON serialize a child attribute. "
          "Did you forget to make it an instance of `Config`?", e_str)
Serializes this instance to a JSON string.
language/canine/config_utils.py