forked from loafle/openapi-generator-original
update python reserved words to include local variable names in api
methods
This commit is contained in:
@@ -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).")
|
||||
|
||||
Reference in New Issue
Block a user