import pathlib
import json


def json_data(request, name: str):
    """Loads a json file."""
    path = pathlib.Path(request.fspath, "fixtures", name)
    with path.open("r") as fp:
        return json.load(fp)