import json


def to_json(recipe_list):
    """
    Function used to serialize a list of recipes.

    :param recipe_list: list(Recipe). list of recipes
    :return: json. A json dictionary to be serialized.
    """
    return json.dumps(recipe_list, default=lambda o: o.__dict__,
                      sort_keys=True, indent=4)