[Flask] self and None are reserved words (#6111)

* setReservedWordsLowerCase was called twice, the second time without self and None

* True, False and nonlocal are python3 reserved words
This commit is contained in:
Pierre Lamot 2017-07-19 10:04:27 +02:00
parent dad3e6018a
commit 6b85416f47

View File

@ -69,7 +69,7 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
typeMapping.put("file", "file");
typeMapping.put("UUID", "str");
// from https://docs.python.org/release/2.5.4/ref/keywords.html
// from https://docs.python.org/3/reference/lexical_analysis.html#keywords
setReservedWordsLowerCase(
Arrays.asList(
// @property
@ -78,7 +78,7 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
"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", "None"));
"return", "def", "for", "lambda", "try", "self", "None", "True", "False", "nonlocal"));
// set the output folder here
outputFolder = "generated-code/connexion";
@ -93,14 +93,6 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
*/
embeddedTemplateDir = templateDir = "flaskConnexion";
// from https://docs.python.org/release/2.5.4/ref/keywords.html
setReservedWordsLowerCase(
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"));
/*
* Additional Properties. These values can be passed to the templates and
* are available in models, apis, and supporting files