updated client per #669
This commit is contained in:
20
dist/lib/swagger-client.js
vendored
20
dist/lib/swagger-client.js
vendored
@@ -1002,7 +1002,7 @@ var Model = function(name, definition) {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.definition = definition || {};
|
this.definition = definition || {};
|
||||||
this.properties = [];
|
this.properties = [];
|
||||||
var requiredFields = definition.enum || [];
|
var requiredFields = definition.required || [];
|
||||||
|
|
||||||
var key;
|
var key;
|
||||||
var props = definition.properties;
|
var props = definition.properties;
|
||||||
@@ -1063,7 +1063,7 @@ Model.prototype.getMockSignature = function(modelsToIgnore) {
|
|||||||
var prop = this.properties[i];
|
var prop = this.properties[i];
|
||||||
var ref = prop['$ref'];
|
var ref = prop['$ref'];
|
||||||
var model = models[ref];
|
var model = models[ref];
|
||||||
if (model && typeof modelsToIgnore === 'undefined') {
|
if (model && typeof modelsToIgnore[model.name] === 'undefined') {
|
||||||
returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
|
returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1085,6 +1085,7 @@ var Property = function(name, obj, required) {
|
|||||||
obj = obj.items;
|
obj = obj.items;
|
||||||
}
|
}
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.description = obj.description;
|
||||||
this.obj = obj;
|
this.obj = obj;
|
||||||
this.optional = true;
|
this.optional = true;
|
||||||
this.example = obj.example || null;
|
this.example = obj.example || null;
|
||||||
@@ -1182,12 +1183,17 @@ simpleRef = function(name) {
|
|||||||
|
|
||||||
Property.prototype.toString = function() {
|
Property.prototype.toString = function() {
|
||||||
var str = getStringSignature(this.obj);
|
var str = getStringSignature(this.obj);
|
||||||
if(str !== '')
|
if(str !== '') {
|
||||||
str = this.name + ' : ' + str;
|
str = '<span class="propName ' + this.required + '">' + this.name + '</span> (<span class="propType">' + str + '</span>';
|
||||||
|
if(!this.required)
|
||||||
|
str += ', <span class="propOptKey">optional</span>';
|
||||||
|
str += ')';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
str = this.name + ' : ' + JSON.stringify(this.obj);
|
str = this.name + ' (' + JSON.stringify(this.obj) + ')';
|
||||||
if(!this.required)
|
|
||||||
str += ' (optional)';
|
if(typeof this.description !== 'undefined')
|
||||||
|
str += ': ' + this.description;
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1002,7 +1002,7 @@ var Model = function(name, definition) {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.definition = definition || {};
|
this.definition = definition || {};
|
||||||
this.properties = [];
|
this.properties = [];
|
||||||
var requiredFields = definition.enum || [];
|
var requiredFields = definition.required || [];
|
||||||
|
|
||||||
var key;
|
var key;
|
||||||
var props = definition.properties;
|
var props = definition.properties;
|
||||||
@@ -1063,7 +1063,7 @@ Model.prototype.getMockSignature = function(modelsToIgnore) {
|
|||||||
var prop = this.properties[i];
|
var prop = this.properties[i];
|
||||||
var ref = prop['$ref'];
|
var ref = prop['$ref'];
|
||||||
var model = models[ref];
|
var model = models[ref];
|
||||||
if (model && typeof modelsToIgnore === 'undefined') {
|
if (model && typeof modelsToIgnore[model.name] === 'undefined') {
|
||||||
returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
|
returnVal = returnVal + ('<br>' + model.getMockSignature(modelsToIgnore));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1085,6 +1085,7 @@ var Property = function(name, obj, required) {
|
|||||||
obj = obj.items;
|
obj = obj.items;
|
||||||
}
|
}
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.description = obj.description;
|
||||||
this.obj = obj;
|
this.obj = obj;
|
||||||
this.optional = true;
|
this.optional = true;
|
||||||
this.example = obj.example || null;
|
this.example = obj.example || null;
|
||||||
@@ -1182,12 +1183,17 @@ simpleRef = function(name) {
|
|||||||
|
|
||||||
Property.prototype.toString = function() {
|
Property.prototype.toString = function() {
|
||||||
var str = getStringSignature(this.obj);
|
var str = getStringSignature(this.obj);
|
||||||
if(str !== '')
|
if(str !== '') {
|
||||||
str = this.name + ' : ' + str;
|
str = '<span class="propName ' + this.required + '">' + this.name + '</span> (<span class="propType">' + str + '</span>';
|
||||||
|
if(!this.required)
|
||||||
|
str += ', <span class="propOptKey">optional</span>';
|
||||||
|
str += ')';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
str = this.name + ' : ' + JSON.stringify(this.obj);
|
str = this.name + ' (' + JSON.stringify(this.obj) + ')';
|
||||||
if(!this.required)
|
|
||||||
str += ' (optional)';
|
if(typeof this.description !== 'undefined')
|
||||||
|
str += ': ' + this.description;
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user