def add_path(prev: Optional[ResponsePath], key: Union[str, int]) -> ResponsePath:
    """Add a key to a response path.

    Given a ResponsePath and a key, return a new ResponsePath containing the new key.
    """
    return ResponsePath(prev, key)
Add a key to a response path.

    Given a ResponsePath and a key, return a new ResponsePath containing the new key.