This commit is contained in:
Tony Tam
2016-01-13 09:49:59 -08:00
3 changed files with 15 additions and 15 deletions

12
dist/swagger-ui.js vendored
View File

@@ -25126,7 +25126,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
if ('validatorUrl' in opts.swaggerOptions) { if ('validatorUrl' in opts.swaggerOptions) {
// Validator URL specified explicitly // Validator URL specified explicitly
this.model.validatorUrl = opts.swaggerOptions.validatorUrl; this.model.validatorUrl = opts.swaggerOptions.validatorUrl;
} else if (this.model.url.indexOf('localhost') > 0) { } else if (this.model.url.indexOf('localhost') > 0 || this.model.url.indexOf('127.0.0.1') > 0) {
// Localhost override // Localhost override
this.model.validatorUrl = null; this.model.validatorUrl = null;
} else { } else {
@@ -25241,10 +25241,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.parentId = this.model.parentId; this.parentId = this.model.parentId;
this.nickname = this.model.nickname; this.nickname = this.model.nickname;
this.model.encodedParentId = encodeURIComponent(this.parentId); this.model.encodedParentId = encodeURIComponent(this.parentId);
if (opts.swaggerOptions) { if (opts.swaggerOptions) {
this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering; this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering;
if (opts.swaggerOptions.showRequestHeaders) { if (opts.swaggerOptions.showRequestHeaders) {
this.model.showRequestHeaders = true; this.model.showRequestHeaders = true;
} }
@@ -25497,7 +25497,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// This is required for JsonEditor to display the root properly // This is required for JsonEditor to display the root properly
if(!param.schema.type){ if(!param.schema.type){
param.schema.type = 'object'; param.schema.type = 'object';
} }
// This is the title that will be used by JsonEditor for the root // This is the title that will be used by JsonEditor for the root
// Since we already display the parameter's name in the Parameter column // Since we already display the parameter's name in the Parameter column
// We set this to space, we can't set it to null or space otherwise JsonEditor // We set this to space, we can't set it to null or space otherwise JsonEditor
@@ -25505,7 +25505,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
if(!param.schema.title){ if(!param.schema.title){
param.schema.title = ' '; param.schema.title = ' ';
} }
} }
var paramView = new SwaggerUi.Views.ParameterView({ var paramView = new SwaggerUi.Views.ParameterView({
model: param, model: param,
@@ -25926,7 +25926,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// adds curl output // adds curl output
var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType}); var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
curlCommand = curlCommand.replace('!', '!'); curlCommand = curlCommand.replace('!', '!');
$( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>'); $( 'div.curl', $(this.el)).html('<pre>' + _.escape(curlCommand) + '</pre>');
// only highlight the response if response is less than threshold, default state is highlight response // only highlight the response if response is less than threshold, default state is highlight response
var opts = this.options.swaggerOptions; var opts = this.options.swaggerOptions;

File diff suppressed because one or more lines are too long

View File

@@ -19,10 +19,10 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.parentId = this.model.parentId; this.parentId = this.model.parentId;
this.nickname = this.model.nickname; this.nickname = this.model.nickname;
this.model.encodedParentId = encodeURIComponent(this.parentId); this.model.encodedParentId = encodeURIComponent(this.parentId);
if (opts.swaggerOptions) { if (opts.swaggerOptions) {
this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering; this.model.defaultRendering = opts.swaggerOptions.defaultModelRendering;
if (opts.swaggerOptions.showRequestHeaders) { if (opts.swaggerOptions.showRequestHeaders) {
this.model.showRequestHeaders = true; this.model.showRequestHeaders = true;
} }
@@ -275,7 +275,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// This is required for JsonEditor to display the root properly // This is required for JsonEditor to display the root properly
if(!param.schema.type){ if(!param.schema.type){
param.schema.type = 'object'; param.schema.type = 'object';
} }
// This is the title that will be used by JsonEditor for the root // This is the title that will be used by JsonEditor for the root
// Since we already display the parameter's name in the Parameter column // Since we already display the parameter's name in the Parameter column
// We set this to space, we can't set it to null or space otherwise JsonEditor // We set this to space, we can't set it to null or space otherwise JsonEditor
@@ -283,7 +283,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
if(!param.schema.title){ if(!param.schema.title){
param.schema.title = ' '; param.schema.title = ' ';
} }
} }
var paramView = new SwaggerUi.Views.ParameterView({ var paramView = new SwaggerUi.Views.ParameterView({
model: param, model: param,
@@ -704,7 +704,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
// adds curl output // adds curl output
var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType}); var curlCommand = this.model.asCurl(this.map, {responseContentType: contentType});
curlCommand = curlCommand.replace('!', '&#33;'); curlCommand = curlCommand.replace('!', '&#33;');
$( 'div.curl', $(this.el)).html('<pre>' + curlCommand + '</pre>'); $( 'div.curl', $(this.el)).html('<pre>' + _.escape(curlCommand) + '</pre>');
// only highlight the response if response is less than threshold, default state is highlight response // only highlight the response if response is less than threshold, default state is highlight response
var opts = this.options.swaggerOptions; var opts = this.options.swaggerOptions;