rebuilt file
This commit is contained in:
76
dist/lib/swagger-client.js
vendored
76
dist/lib/swagger-client.js
vendored
@@ -2458,8 +2458,22 @@ var Property = function(name, obj, required) {
|
||||
this.description = obj.description;
|
||||
this.obj = obj;
|
||||
this.optional = true;
|
||||
this.optional = !required;
|
||||
this.default = obj.default || null;
|
||||
this.example = obj.example || null;
|
||||
this.collectionFormat = obj.collectionFormat || null;
|
||||
this.maximum = obj.maximum || null;
|
||||
this.exclusiveMaximum = obj.exclusiveMaximum || null;
|
||||
this.minimum = obj.minimum || null;
|
||||
this.exclusiveMinimum = obj.exclusiveMinimum || null;
|
||||
this.maxLength = obj.maxLength || null;
|
||||
this.minLength = obj.minLength || null;
|
||||
this.pattern = obj.pattern || null;
|
||||
this.maxItems = obj.maxItems || null;
|
||||
this.minItems = obj.minItems || null;
|
||||
this.uniqueItems = obj.uniqueItems || null;
|
||||
this.enum = obj.enum || null;
|
||||
this.multipleOf = obj.multipleOf || null;
|
||||
};
|
||||
|
||||
Property.prototype.getSampleValue = function (modelsToIgnore) {
|
||||
@@ -2575,9 +2589,71 @@ Property.prototype.toString = function() {
|
||||
|
||||
if(typeof this.description !== 'undefined')
|
||||
str += ': ' + this.description;
|
||||
|
||||
var options = '';
|
||||
var isArray = this.schema.type === 'array';
|
||||
var type = isArray ? this.schema.items.type : this.schema.type;
|
||||
|
||||
if (this.default)
|
||||
options += optionHtml('Default', this.default);
|
||||
|
||||
switch (type) {
|
||||
case 'string':
|
||||
if (this.minLength)
|
||||
options += optionHtml('Min. Length', this.minLength);
|
||||
if (this.maxLength)
|
||||
options += optionHtml('Max. Length', this.maxLength);
|
||||
if (this.pattern)
|
||||
options += optionHtml('Reg. Exp.', this.pattern);
|
||||
break;
|
||||
case 'integer':
|
||||
case 'number':
|
||||
if (this.minimum)
|
||||
options += optionHtml('Min. Value', this.minimum);
|
||||
if (this.exclusiveMinimum)
|
||||
options += optionHtml('Exclusive Min.', "true");
|
||||
if (this.maximum)
|
||||
options += optionHtml('Max. Value', this.maximum);
|
||||
if (this.exclusiveMaximum)
|
||||
options += optionHtml('Exclusive Max.', "true");
|
||||
if (this.multipleOf)
|
||||
options += optionHtml('Multiple Of', this.multipleOf);
|
||||
break;
|
||||
}
|
||||
|
||||
if (isArray) {
|
||||
if (this.minItems)
|
||||
options += optionHtml('Min. Items', this.minItems);
|
||||
if (this.maxItems)
|
||||
options += optionHtml('Max. Items', this.maxItems);
|
||||
if (this.uniqueItems)
|
||||
options += optionHtml('Unique Items', "true");
|
||||
if (this.collectionFormat)
|
||||
options += optionHtml('Coll. Format', this.collectionFormat);
|
||||
}
|
||||
|
||||
if (this.enum) {
|
||||
var enumString;
|
||||
|
||||
if (type === 'number' || type === 'integer')
|
||||
enumString = this.enum.join(', ');
|
||||
else {
|
||||
enumString = '"' + this.enum.join('", "') + '"';
|
||||
}
|
||||
|
||||
options += optionHtml('Enum', enumString);
|
||||
}
|
||||
|
||||
if (options.length > 0)
|
||||
str = '<span class="propWrap">' + str + '<table class="optionsWrapper"><tr><th colspan="2">' + this.name + '</th></tr>' + options + '</table></span>';
|
||||
|
||||
return str;
|
||||
};
|
||||
|
||||
optionHtml = function(label, value) {
|
||||
return '<tr><td class="optionName">' + label + ':</td><td>' + value + '</td></tr>';
|
||||
}
|
||||
|
||||
typeFromJsonSchema = function(type, format) {
|
||||
var str;
|
||||
if(type === 'integer' && format === 'int32')
|
||||
|
||||
Reference in New Issue
Block a user