escape callback parameter for java(okhttp) and python

This commit is contained in:
wing328
2016-09-29 17:41:47 +08:00
parent 34525853b6
commit f59c28d08a
12 changed files with 223 additions and 196 deletions

View File

@@ -377,6 +377,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
@Override
public String toParamName(String name) {
// to avoid conflicts with 'callback' parameter for async call
if ("callback".equals(name)) {
return "paramCallback";
}
// should be the same as variable name
return toVarName(name);
}

View File

@@ -349,6 +349,11 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
@Override
public String toParamName(String name) {
// to avoid conflicts with 'callback' parameter for async call
if ("callback".equals(name)) {
return "param_callback";
}
// should be the same as variable name
return toVarName(name);
}