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});
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -530,13 +530,35 @@ var Operation = function(parent, operationId, httpMethod, path, args, definition
|
||||
var i;
|
||||
for(i = 0; i < this.parameters.length; i++) {
|
||||
var param = this.parameters[i];
|
||||
type = this.getType(param);
|
||||
if(type.toLowerCase() === 'boolean') {
|
||||
param.allowableValues = {};
|
||||
param.allowableValues.values = ["true", "false"];
|
||||
if(param.type === 'array') {
|
||||
param.isList = true;
|
||||
param.allowMultiple = true;
|
||||
}
|
||||
param.signature = this.getSignature(type, models);
|
||||
param.sampleJSON = this.getSampleJSON(type, models);
|
||||
var innerType = this.getType(param);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user