-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
Hi Guys.
I found an issue where the swagger ui would keep loading when the response of a GET request contains an attachment. The response headers include Content-Disposition →attachment; filename=example.txt and Content-Type →text/plain; charset=UTF-8 along some others.
The error that I was getting was this: Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': No function was found that matched the signature provided.
To fix this, I had to make some changes in the swagger-ui.js.
@@ -23447,7 +23447,11 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
var type = contentType || 'text/html';
var a = document.createElement('a');
var href = window.URL.createObjectURL(content);
var binaryData = [];
binaryData.push(content);
var href = window.URL.createObjectURL(new Blob(binaryData, {type: type}));
var fileName = response.url.substr(response.url.lastIndexOf('/') + 1);
var download = [type, fileName, href].join(':');
I am using swagger-ui-2.2.5. Can anyone confirm this error and if so, make the above mentioned changes and merge it?
Thanks.
tomsaleeba and satyakokku
Metadata
Metadata
Assignees
Labels
No labels