def _build_var(var, property_path=None):
if not property_path:<EOL><INDENT>property_path = []<EOL><DEDENT>if not is_config_var(var):<EOL><INDENT>raise ValueError(f"<STR_LIT>")<EOL><DEDENT>entry = var.metadata[CONFIG_KEY]<EOL>var_name = entry.name if entry.name else var.name<EOL>schema = {"<STR_LIT>": f"<STR_LIT>"}<EOL>if var.default is not None:<EOL><INDENT>schema["<STR_LIT:default>"] = var.default<EOL><DEDENT>if entry is not None:<EOL><INDENT>if isinstance(entry.title, str):<EOL><INDENT>schema["<STR_LIT:title>"] = entry.title<EOL><DEDENT>if isinstance(entry.description, str):<EOL><INDENT>schema["<STR_LIT:description>"] = entry.description<EOL><DEDENT>if isinstance(entry.examples, collections.Iterable) and len(entry.examples) > <NUM_LIT:0>:<EOL><INDENT>schema["<STR_LIT>"] = entry.examples<EOL><DEDENT><DEDENT>if is_union_type(var.type):<EOL><INDENT>type_union = {"<STR_LIT>": []}<EOL>for allowed_type in var.type.__args__:<EOL><INDENT>type_union["<STR_LIT>"].append(<EOL>_build_type(<EOL>allowed_type, allowed_type, property_path=property_path + [var_name]<EOL>)<EOL>)<EOL><DEDENT>schema.update(type_union)<EOL><DEDENT>else:<EOL><INDENT>schema.update(<EOL>_build_type(var.type, var, property_path=property_path + [var_name])<EOL>)<EOL><DEDENT>return schema<EOL>
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]