fix for #191, not detecting correct file name

This commit is contained in:
Tony Tam
2015-02-16 17:18:19 -08:00
parent c7c3c969db
commit 5790c7d289
8 changed files with 173 additions and 118 deletions

View File

@@ -6,7 +6,7 @@ import java.util.*;
public class CodegenOperation {
public Boolean hasConsumes, hasProduces, hasParams, returnTypeIsPrimitive,
returnSimpleType, subresourceOperation;
returnSimpleType, subresourceOperation, isMapContainer, isListContainer;
public String path, operationId, returnType, httpMethod, returnBaseType,
returnContainer, summary, notes, baseName, defaultResponse;

View File

@@ -641,6 +641,10 @@ public class DefaultCodegen {
op.returnType = cm.datatype;
if(cm.isContainer != null) {
op.returnContainer = cm.containerType;
if("map".equals(cm.containerType))
op.isMapContainer = Boolean.TRUE;
else if ("list".equalsIgnoreCase(cm.containerType))
op.isListContainer = Boolean.TRUE;
}
else
op.returnSimpleType = true;
@@ -697,7 +701,7 @@ public class DefaultCodegen {
bodyParams.add(p.copy());
}
else if(param instanceof FormParameter) {
if("file".equalsIgnoreCase(p.dataType))
if("file".equalsIgnoreCase(((FormParameter)param).getType()))
p.isFile = true;
else
p.notFile = true;