Skip to content

Commit f32bd41

Browse files
committed
Merge pull request #78 from HughePaul/bug-nobooleandropdown
Add in missing length for allowableValues.values for loop
2 parents 35c4649 + 4de4ad1 commit f32bd41

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

lib/swagger.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -659,19 +659,21 @@ var SwaggerOperation = function(nickname, path, method, parameters, summary, not
659659
param.isList = true;
660660
if(param.allowableValues != null) {
661661
param.allowableValues.descriptiveValues = [];
662-
for(j = 0; j < param.allowableValues.values; j++){
663-
var v = param.allowableValues.values[j];
664-
if(param.defaultValue != null) {
665-
param.allowableValues.descriptiveValues.push ({
666-
value: String(v),
667-
isDefault: (v === param.defaultValue)
668-
});
669-
}
670-
else {
671-
param.allowableValues.descriptiveValues.push ({
672-
value: String(v),
673-
isDefault: false
674-
});
662+
if(param.allowableValues.values) {
663+
for(j = 0; j < param.allowableValues.values.length; j++){
664+
var v = param.allowableValues.values[j];
665+
if(param.defaultValue != null) {
666+
param.allowableValues.descriptiveValues.push ({
667+
value: String(v),
668+
isDefault: (v === param.defaultValue)
669+
});
670+
}
671+
else {
672+
param.allowableValues.descriptiveValues.push ({
673+
value: String(v),
674+
isDefault: false
675+
});
676+
}
675677
}
676678
}
677679
}

0 commit comments

Comments
 (0)