updated swagger-js library
This commit is contained in:
5
dist/lib/swagger-client.js
vendored
5
dist/lib/swagger-client.js
vendored
@@ -552,6 +552,11 @@ var Operation = function(parent, operationId, httpMethod, path, args, definition
|
|||||||
param.allowableValues.descriptiveValues.push({value : value, isDefault: isDefault});
|
param.allowableValues.descriptiveValues.push({value : value, isDefault: isDefault});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(param.type === 'array' && typeof param.allowableValues === 'undefined') {
|
||||||
|
// can't show as a list if no values to select from
|
||||||
|
delete param.isList;
|
||||||
|
delete param.allowMultiple;
|
||||||
|
}
|
||||||
param.signature = this.getSignature(innerType, models);
|
param.signature = this.getSignature(innerType, models);
|
||||||
param.sampleJSON = this.getSampleJSON(innerType, models);
|
param.sampleJSON = this.getSampleJSON(innerType, models);
|
||||||
param.responseClassSignature = param.signature;
|
param.responseClassSignature = param.signature;
|
||||||
|
|||||||
@@ -530,13 +530,35 @@ var Operation = function(parent, operationId, httpMethod, path, args, definition
|
|||||||
var i;
|
var i;
|
||||||
for(i = 0; i < this.parameters.length; i++) {
|
for(i = 0; i < this.parameters.length; i++) {
|
||||||
var param = this.parameters[i];
|
var param = this.parameters[i];
|
||||||
type = this.getType(param);
|
if(param.type === 'array') {
|
||||||
if(type.toLowerCase() === 'boolean') {
|
param.isList = true;
|
||||||
param.allowableValues = {};
|
param.allowMultiple = true;
|
||||||
param.allowableValues.values = ["true", "false"];
|
|
||||||
}
|
}
|
||||||
param.signature = this.getSignature(type, models);
|
var innerType = this.getType(param);
|
||||||
param.sampleJSON = this.getSampleJSON(type, models);
|
if(innerType.toString().toLowerCase() === 'boolean') {
|
||||||
|
param.allowableValues = {};
|
||||||
|
param.isList = true;
|
||||||
|
param.enum = ["true", "false"];
|
||||||
|
}
|
||||||
|
if(typeof param.enum !== 'undefined') {
|
||||||
|
var id;
|
||||||
|
param.allowableValues = {};
|
||||||
|
param.allowableValues.values = [];
|
||||||
|
param.allowableValues.descriptiveValues = [];
|
||||||
|
for(id = 0; id < param.enum.length; id++) {
|
||||||
|
var value = param.enum[id];
|
||||||
|
var isDefault = (value === param.default) ? true : false;
|
||||||
|
param.allowableValues.values.push(value);
|
||||||
|
param.allowableValues.descriptiveValues.push({value : value, isDefault: isDefault});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(param.type === 'array' && typeof param.allowableValues === 'undefined') {
|
||||||
|
// can't show as a list if no values to select from
|
||||||
|
delete param.isList;
|
||||||
|
delete param.allowMultiple;
|
||||||
|
}
|
||||||
|
param.signature = this.getSignature(innerType, models);
|
||||||
|
param.sampleJSON = this.getSampleJSON(innerType, models);
|
||||||
param.responseClassSignature = param.signature;
|
param.responseClassSignature = param.signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user