update python reserved words to include local variable names in api

methods
This commit is contained in:
wing328
2016-01-06 23:00:05 +08:00
parent 9ab27cd848
commit 22b5f02ec3
3 changed files with 16 additions and 5 deletions

View File

@@ -55,10 +55,14 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
// from https://docs.python.org/release/2.5.4/ref/keywords.html
reservedWords = new HashSet<String>(
Arrays.asList(
"and", "del", "from", "not", "while", "as", "elif", "global", "or", "with",
"assert", "else", "if", "pass", "yield", "break", "except", "import",
"print", "class", "exec", "in", "raise", "continue", "finally", "is",
"return", "def", "for", "lambda", "try", "self"));
// local variable name used in API methods (endpoints)
"all_params", "resource_path", "method", "path_params", "query_params",
"header_params", "form_params", "files", "body_params", "auth_settings",
// python reserved words
"and", "del", "from", "not", "while", "as", "elif", "global", "or", "with",
"assert", "else", "if", "pass", "yield", "break", "except", "import",
"print", "class", "exec", "in", "raise", "continue", "finally", "is",
"return", "def", "for", "lambda", "try", "self"));
cliOptions.clear();
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "python package name (convention: snake_case).")