fixed support for default values in param_list

This commit is contained in:
Josh Ponelat
2015-06-04 08:45:37 +02:00
parent 9ba75c02be
commit a126c17841
2 changed files with 18 additions and 18 deletions

View File

@@ -30,7 +30,13 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
this.model.paramType = this.model.in || this.model.paramType;
this.model.isBody = this.model.paramType === 'body' || this.model.in === 'body';
this.model.isFile = type && type.toLowerCase() === 'file';
this.model.default = (this.model.default || this.model.defaultValue);
// Allow for default === false
if(typeof this.model.default === 'undefined') {
this.model.default = this.model.defaultValue;
}
this.model.hasDefault = (typeof this.model.default !== 'undefined');
this.model.valueId = 'm' + this.model.name + Math.random();
if (this.model.allowableValues) {
@@ -99,4 +105,4 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
}
}
}
});
});