<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_object_type(var, property_path=None):
 """ Builds schema definitions for object type values. :param var: The object type value :param List[str] property_path: The property path of the current type, defaults to None, optional :param property_path: [type], optional :return: The built schema definition :rtype: Dict[str, Any] """


    if not property_path:
        property_path = []

    schema = {"type": "object"}
    if is_builtin_type(var):
        return schema

    entry = var.metadata[CONFIG_KEY]

    if isinstance(entry.min, int):
        schema["minProperties"] = entry.min
    if isinstance(entry.max, int):
        schema["maxProperties"] = entry.max

    # NOTE: typing.Dict only accepts two typing arguments
    if is_typing_type(var.type) and len(var.type.__args__) == 2:
        (key_type, value_type) = var.type.__args__

        key_pattern = "^(.*)$"
        if is_regex_type(key_type):
            key_pattern = key_type.__supertype__.pattern
        elif not is_string_type(key_type):
            raise ValueError(
                f"cannot serialize object with key of type {key_type!r}, "
                f"located in var {var.name!r}"
            )

        schema["patternProperties"] = {
            key_pattern: _build(value_type, property_path=property_path)
        }

    return schema