added root checking per #279

This commit is contained in:
Tony Tam 2014-10-02 00:32:15 -07:00
parent e771ed3332
commit 5024e0bbda

View File

@ -502,6 +502,10 @@ public class DefaultCodegen {
path = path.replaceAll("\\}", "");
String[] parts = (path + "/" + httpMethod).split("/");
StringBuilder builder = new StringBuilder();
if("/".equals(path)) {
// must be root path
builder.append("root");
}
for(int i = 0; i < parts.length; i++) {
String part = parts[i];
if(part.length() > 0) {