import typing


def _retrieve_json(json_path: typing.List[str], obj: typing.Dict[str, typing.Any]) -> typing.Any:
    """Retrieve object from nested dicts."""
    if json_path:
        return _retrieve_json(json_path[1:], obj[json_path[0]])
    else:
        return obj