import json


def _load_jsonschema(repo_version):
    """Opens and parses the repo schema based on the version provided.

    :param repo_version: repo schema version. E.g. v3 vs v4
    :type repo_version: str
    :return: the schema dictionary
    :rtype: dict
    """

    with open(
        'repo/meta/schema/{}-repo-schema.json'.format(repo_version),
        encoding='utf-8'
    ) as schema_file:
        return json.loads(schema_file.read())