Skip to content

Commit e666485

Browse files
committed
Support plain text in response
Fixes #1109 Fixes #1111
1 parent e0687b0 commit e666485

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

dist/lib/swagger-oauth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ window.onOAuthComplete = function onOAuthComplete(token) {
277277
}
278278
}
279279
});
280-
window.authorizations.add(oauth2KeyName, new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
280+
window.swaggerUi.api.clientAuthorizations.add(oauth2KeyName, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
281281
}
282282
}
283283
}

dist/swagger-ui.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20692,7 +20692,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
2069220692
} else {
2069320693

2069420694
// Default validator
20695-
this.model.validatorUrl = 'http://online.swagger.io/validator';
20695+
this.model.validatorUrl = window.location.protocol + '//online.swagger.io/validator';
2069620696
}
2069720697
}
2069820698
},
@@ -21358,6 +21358,12 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
2135821358
code = $('<code />').html(_.escape(content));
2135921359
pre = $('<pre class="xml" />').append(code);
2136021360

21361+
// Plain Text
21362+
} else if (/text\/plain/.test(contentType)) {
21363+
code = $('<code />').text(content);
21364+
pre = $('<pre class="plain" />').append(code);
21365+
21366+
2136121367
// Image
2136221368
} else if (/^image\//.test(contentType)) {
2136321369
pre = $('<img>').attr('src', url);

dist/swagger-ui.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/javascript/view/OperationView.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,12 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
594594
code = $('<code />').html(_.escape(content));
595595
pre = $('<pre class="xml" />').append(code);
596596

597+
// Plain Text
598+
} else if (/text\/plain/.test(contentType)) {
599+
code = $('<code />').text(content);
600+
pre = $('<pre class="plain" />').append(code);
601+
602+
597603
// Image
598604
} else if (/^image\//.test(contentType)) {
599605
pre = $('<img>').attr('src', url);

0 commit comments

Comments
 (0)