add defensive null check

This commit is contained in:
russellb337 2015-08-10 13:58:02 -07:00
parent 0a8fb1e532
commit ae4b4979a7

View File

@ -423,12 +423,14 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
}
//need to propagate path level down to the operation
if(path.getParameters() != null) {
for (Parameter parameter : path.getParameters()) {
//skip propagation if a parameter with the same name is already defined at the operation level
if (!operationParameters.contains(generateParameterId(parameter))) {
operation.addParameter(parameter);
}
}
}
for (String tag : tags) {
CodegenOperation co = config.fromOperation(resourcePath, httpMethod, operation, swagger.getDefinitions());