def serialize_artifact_json_blobs(artifacts):
    """
    Ensure that JSON artifact blobs passed as dicts are converted to JSON
    """
    for artifact in artifacts:
        blob = artifact['blob']
        if (artifact['type'].lower() == 'json' and
                not isinstance(blob, str)):
            artifact['blob'] = json.dumps(blob)

    return artifacts
Ensure that JSON artifact blobs passed as dicts are converted to JSON