def METHOD_NAME(schema_as_dict: dict) -> None:
    """Sometimes "required" and "anyOf" lists come unsorted, causing misleading assertion failures; this corrects the issue.
    Args:
        schema_as_dict: source dictionary (will be modified "in-situ")
    """
    key: str
    value: Any
    for key, value in schema_as_dict.items():
        if key == "required":
            schema_as_dict[key] = sorted(value)
        elif key == "anyOf":
            if isinstance(value, list):
                for val in value:
                    if isinstance(value, dict):
                        schema_as_dict[key] = sorted(val, key=_sort_any_of)
            else:
                schema_as_dict[key] = sorted(value, key=_sort_any_of)
        if isinstance(value, dict):
            METHOD_NAME(schema_as_dict=value)