fix for #640
This commit is contained in:
30
dist/lib/swagger-client.js
vendored
30
dist/lib/swagger-client.js
vendored
@@ -325,7 +325,6 @@ SwaggerClient.prototype.initialize = function (url, options) {
|
||||
|
||||
if (typeof options.success === 'function') {
|
||||
this.build();
|
||||
// this.isBuilt = true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1214,7 +1213,6 @@ Model.prototype.getMockSignature = function(modelsToIgnore) {
|
||||
prop = this.properties[i];
|
||||
propertiesStr.push(prop.toString());
|
||||
}
|
||||
|
||||
var strong = '<span class="strong">';
|
||||
var stronger = '<span class="stronger">';
|
||||
var strongClose = '</span>';
|
||||
@@ -1326,8 +1324,10 @@ Property.prototype.sampleValue = function(isArray, ignoredModels) {
|
||||
|
||||
getStringSignature = function(obj) {
|
||||
var str = '';
|
||||
if(typeof obj.type === 'undefined')
|
||||
str += obj;
|
||||
if(typeof obj.$ref !== 'undefined')
|
||||
str += simpleRef(obj.$ref);
|
||||
else if(typeof obj.type === 'undefined')
|
||||
str += 'object';
|
||||
else if(obj.type === 'array') {
|
||||
str += 'Array[';
|
||||
str += getStringSignature((obj.items || obj.$ref || {}));
|
||||
@@ -1383,9 +1383,27 @@ Property.prototype.toString = function() {
|
||||
if(typeof this.description !== 'undefined')
|
||||
str += ': ' + this.description;
|
||||
|
||||
if (this['enum']) {
|
||||
str += ' = <span class="propVals">[\'' + this['enum'].join('\' or \'') + '\']</span>';
|
||||
}
|
||||
if (this.descr) {
|
||||
str += ': <span class="propDesc">' + this.descr + '</span>';
|
||||
}
|
||||
|
||||
|
||||
var options = '';
|
||||
var isArray = this.schema.type === 'array';
|
||||
var type = isArray ? this.schema.items.type : this.schema.type;
|
||||
var type;
|
||||
|
||||
if(isArray) {
|
||||
if(this.schema.items)
|
||||
type = this.schema.items.type;
|
||||
else
|
||||
type = '';
|
||||
}
|
||||
else {
|
||||
this.schema.type;
|
||||
}
|
||||
|
||||
if (this.default)
|
||||
options += optionHtml('Default', this.default);
|
||||
@@ -1973,7 +1991,7 @@ SwaggerModelProperty.prototype.toString = function () {
|
||||
}
|
||||
str += ')';
|
||||
if (this.values) {
|
||||
str += ' = <span class="propVals">["' + this.values.join('\' or \'') + '\']</span>';
|
||||
str += ' = <span class="propVals">[\'' + this.values.join('\' or \'') + '\']</span>';
|
||||
}
|
||||
if (this.descr) {
|
||||
str += ': <span class="propDesc">' + this.descr + '</span>';
|
||||
|
||||
Reference in New Issue
Block a user