import json


def create_schema_with_answer_id(answer_id):
    """
    Utility method that loads a JSON schema file and swaps out an answer Id.
    :param answer_id: The Id to use for the answer.
    :return: The JSON file with the Id swapped for schema_id
    """
    schema_path = "tests/schemas/valid/test_schema_id_regex.json"

    with open(schema_path, encoding="utf8") as json_data:
        json_content = json.load(json_data)

        json_content["sections"][0]["groups"][0]["blocks"][0]["question"]["answers"][0][
            "id"
        ] = answer_id
        return json_content