def validate_metadata(metadata, parameters):
    """validate metatdata.
    Ensure metadata references parameter workload_context,
    and that it is a string.
    Return error message string or None if no errors.
    """
    for value in metadata.values():
        if isinstance(value, dict):
            if "get_param" in value:
                if value["get_param"] == "workload_context":
                    wc = parameters.get("workload_context", {})
                    if wc.get("type") == "string":
                        break
                    else:
                        return (
                            'must have parameter "workload_context"' ' of type "string"'
                        )
                    break
    else:
        return None