added copy function

This commit is contained in:
Tony Tam 2015-02-04 07:21:08 -08:00
parent 7d0e003bf2
commit 67a3fffad7

View File

@ -661,34 +661,34 @@ public class DefaultCodegen {
CodegenParameter p = fromParameter(param, imports); CodegenParameter p = fromParameter(param, imports);
allParams.add(p); allParams.add(p);
if(param instanceof QueryParameter) { if(param instanceof QueryParameter) {
queryParams.add(p);
p.isQueryParam = new Boolean(true); p.isQueryParam = new Boolean(true);
queryParams.add(p.copy());
} }
else if(param instanceof PathParameter) { else if(param instanceof PathParameter) {
p.required = true; p.required = true;
pathParams.add(p);
p.isPathParam = new Boolean(true); p.isPathParam = new Boolean(true);
pathParams.add(p.copy());
} }
else if(param instanceof HeaderParameter) { else if(param instanceof HeaderParameter) {
headerParams.add(p);
p.isHeaderParam = new Boolean(true); p.isHeaderParam = new Boolean(true);
headerParams.add(p.copy());
} }
else if(param instanceof CookieParameter) { else if(param instanceof CookieParameter) {
cookieParams.add(p);
p.isCookieParam = new Boolean(true); p.isCookieParam = new Boolean(true);
cookieParams.add(p.copy());
} }
else if(param instanceof BodyParameter) { else if(param instanceof BodyParameter) {
bodyParams.add(p);
p.isBodyParam = new Boolean(true); p.isBodyParam = new Boolean(true);
bodyParam = p; bodyParam = p;
bodyParams.add(p.copy());
} }
else if(param instanceof FormParameter) { else if(param instanceof FormParameter) {
formParams.add(p); if("file".equals(p.dataType))
if("File".equals(p.dataType))
p.isFile = true; p.isFile = true;
else else
p.notFile = true; p.notFile = true;
p.isFormParam = new Boolean(true); p.isFormParam = new Boolean(true);
formParams.add(p.copy());
} }
} }
} }