from typing import Dict
from typing import Union
from typing import List
from typing import Tuple
from typing import Any
from typing import cast
from typing import Type


def _path_param_reducer(acc: Dict[str, Union[str, List[str]]], cur: Tuple[Dict[str, Any], str]) -> Dict[str, Any]:
    """
    Reducer function - acc is a dictionary, cur is a tuple of a param definition object + raw string value
    """
    param_definition, raw_param = cur
    param_name = cast(str, param_definition["name"])
    param_type = cast(Type, param_definition["type"])
    acc[param_name] = param_type(raw_param)
    return acc