fix, tests for #1822

This commit is contained in:
Tony Tam
2016-01-06 05:29:44 -08:00
parent 8923a541c0
commit 19c81bf7bd
3 changed files with 63 additions and 11 deletions

View File

@@ -1792,6 +1792,20 @@ public class DefaultCodegen {
opList = new ArrayList<CodegenOperation>();
operations.put(tag, opList);
}
// check for operationId uniqueness
String uniqueName = co.operationId;
int counter = 0;
for(CodegenOperation op : opList) {
if(uniqueName.equals(op.operationId)) {
uniqueName = co.operationId + "_" + counter;
counter ++;
}
}
if(!co.operationId.equals(uniqueName)) {
LOGGER.warn("generated unique operationId `" + uniqueName + "`");
}
co.operationId = uniqueName;
opList.add(co);
co.baseName = tag;
}