fixes for #859, ie compat

This commit is contained in:
Tony Tam
2015-01-29 23:02:04 -08:00
parent a969680904
commit 0e69c5e1f4
6 changed files with 308 additions and 308 deletions

View File

@@ -1817,15 +1817,15 @@ var Operation = function(parent, operationId, httpMethod, path, args, definition
if(innerType && innerType.toString().toLowerCase() === 'boolean') {
param.allowableValues = {};
param.isList = true;
param.enum = ["true", "false"];
param['enum'] = ["true", "false"];
}
if(typeof param.enum !== 'undefined') {
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];
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});
@@ -2489,7 +2489,7 @@ var Property = function(name, obj, required) {
this.maxItems = obj.maxItems || null;
this.minItems = obj.minItems || null;
this.uniqueItems = obj.uniqueItems || null;
this.enum = obj.enum || null;
this['enum'] = obj['enum'] || null;
this.multipleOf = obj.multipleOf || null;
};
@@ -2649,13 +2649,13 @@ Property.prototype.toString = function() {
options += optionHtml('Coll. Format', this.collectionFormat);
}
if (this.enum) {
if (this['enum']) {
var enumString;
if (type === 'number' || type === 'integer')
enumString = this.enum.join(', ');
enumString = this['enum'].join(', ');
else {
enumString = '"' + this.enum.join('", "') + '"';
enumString = '"' + this['enum'].join('", "') + '"';
}
options += optionHtml('Enum', enumString);