diff --git a/rendercv/api/functions.py b/rendercv/api/functions.py index 81208dd7..cfbbe7e9 100644 --- a/rendercv/api/functions.py +++ b/rendercv/api/functions.py @@ -9,15 +9,14 @@ from .. import data, renderer def create_contents_of_a_typst_file( - input_file_as_a_dict: dict, + yaml_file_as_string: str, ) -> str | list[dict]: """ - Validate the input file given as a dictionary, generate a Typst file and return it - as a string. If there are any validation errors, return them as a list of - dictionaries. + Validate the input file given as a string, generate a Typst file and return it as a + string. If there are any validation errors, return them as a list of dictionaries. Args: - input_file_as_a_dict: The input file as a dictionary. + yaml_file_as_string: The input file as a string. Returns: The Typst file as a string or a list of dictionaries that contain the error @@ -25,6 +24,7 @@ def create_contents_of_a_typst_file( """ try: + input_file_as_a_dict = data.read_a_yaml_file(yaml_file_as_string) data_model = data.validate_input_dictionary_and_return_the_data_model( input_file_as_a_dict, )