added bodyParam

This commit is contained in:
Tony Tam 2014-10-23 21:21:58 -07:00
parent 237f00e2e3
commit bc974e6514
3 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,7 @@ public class CodegenOperation {
returnContainer, summary, notes, baseName, defaultResponse;
public List<Map<String, String>> consumes, produces;
public CodegenParameter bodyParam;
public List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> bodyParams = new ArrayList<CodegenParameter>();
public List<CodegenParameter> pathParams = new ArrayList<CodegenParameter>();

View File

@ -631,6 +631,7 @@ public class DefaultCodegen {
imports.add(op.returnBaseType);
List<Parameter> parameters = operation.getParameters();
CodegenParameter bodyParam = null;
List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> bodyParams = new ArrayList<CodegenParameter>();
List<CodegenParameter> pathParams = new ArrayList<CodegenParameter>();
@ -731,6 +732,7 @@ public class DefaultCodegen {
else if(param instanceof BodyParameter) {
bodyParams.add(p);
p.isBodyParam = new Boolean(true);
bodyParam = p;
}
// else if(param instanceof FormParameter)
// formParams.add(p);
@ -741,6 +743,7 @@ public class DefaultCodegen {
op.imports.add(i);
}
}
op.bodyParam = bodyParam;
op.httpMethod = httpMethod.toUpperCase();
op.allParams = addHasMore(allParams);
op.bodyParams = addHasMore(bodyParams);

View File

@ -64,6 +64,7 @@ public class DefaultGenerator implements Generator {
hostBuilder.append("https://");
hostBuilder.append(swagger.getHost()).append(swagger.getBasePath());
String basePath = hostBuilder.toString();
List<Object> allOperations = new ArrayList<Object>();
List<Object> allModels = new ArrayList<Object>();