docs: def _build_var(var, property_path=None):
      """ Builds a schema definition for a given config var.
  
      :param attr._make.Attribute var: The var to generate 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 ``var`` is not a file_config var
      :return: The built schema definition
      :rtype: Dict[str, Any]
      """
  
      if not property_path:
          property_path = []
  
      if not is_config_var(var):
          raise ValueError(f"var {var!r} is not a config var")
  
      entry = var.metadata[CONFIG_KEY]
      var_name = entry.name if entry.name else var.name
      schema = {"$id": f"#/{'/'.join(property_path)}/{var_name}"}
  
      if var.default is not None:
          schema["default"] = var.default
  
      if entry is not None:
          if isinstance(entry.title, str):
              schema["title"] = entry.title
          if isinstance(entry.description, str):
              schema["description"] = entry.description
          if isinstance(entry.examples, collections.Iterable) and len(entry.examples) > 0:
              schema["examples"] = entry.examples
  
      # handle typing.Union types by simply using the "anyOf" key
      if is_union_type(var.type):
          type_union = {"anyOf": []}
          for allowed_type in var.type.__args__:
              # NOTE: requires jsonschema draft-07
              type_union["anyOf"].append(
                  _build_type(
                      allowed_type, allowed_type, property_path=property_path + [var_name]
                  )
              )
          schema.update(type_union)
      else:
          schema.update(
              _build_type(var.type, var, property_path=property_path + [var_name])
          )
      return schema