docs: def _build_config(config_cls, property_path=None):
      """ Builds the schema definition for a given config class.
  
      :param class config_cls: The config class to build a schema definition for
      :param List[str] property_path: The property path of the current type,
          defaults to None, optional
      :raises ValueError: When the given ``config_cls`` is not a config decorated class
      :return: The built schema definition
      :rtype: Dict[str, Any]
      """
  
      if not property_path:
          property_path = []
  
      if not is_config_type(config_cls):
          raise ValueError(f"class {config_cls!r} is not a config class")
  
      schema = {"type": "object", "required": [], "properties": {}}
      cls_entry = getattr(config_cls, CONFIG_KEY)
  
      # add schema title, defaults to config classes `__qualname__`
      schema_title = cls_entry.get("title", config_cls.__qualname__)
      if isinstance(schema_title, str):
          schema["title"] = schema_title
  
      schema_description = cls_entry.get("description")
      if isinstance(schema_description, str):
          schema["description"] = schema_description
  
      # if the length of the property path is 0, assume that current object is root
      if len(property_path) <= 0:
          schema["$id"] = f"{config_cls.__qualname__}.json"
          # NOTE: requires draft-07 for typing.Union type schema generation
          schema["$schema"] = "http://json-schema.org/draft-07/schema#"
      else:
          schema["$id"] = f"#/{'/'.join(property_path)}"
  
      property_path.append("properties")
      for var in attr.fields(config_cls):
          if not is_config_var(var):
              # encountered attribute is not a serialized field (i.e. missing CONFIG_KEY)
              continue
          entry = var.metadata[CONFIG_KEY]
          var_name = entry.name if entry.name else var.name
          if entry.required:
              schema["required"].append(var_name)
  
          if is_config_type(var.type):
              schema["properties"][var_name] = _build_config(
                  var.type, property_path=property_path + [var_name]
              )
          else:
              schema["properties"][var_name] = _build_var(
                  var, property_path=property_path
              )
  
      return schema