|
4 | 4 | import com.wordnik.swagger.models.properties.*;
|
5 | 5 |
|
6 | 6 | import java.io.File;
|
| 7 | +import java.util.*; |
7 | 8 |
|
8 | 9 | public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig {
|
9 | 10 | String module = "client";
|
@@ -50,7 +51,14 @@ public PythonClientCodegen() {
|
50 | 51 | typeMapping.put("string", "str");
|
51 | 52 | typeMapping.put("date", "datetime");
|
52 | 53 |
|
53 |
| - |
| 54 | + // from https://docs.python.org/release/2.5.4/ref/keywords.html |
| 55 | + reservedWords = new HashSet<String> ( |
| 56 | + Arrays.asList( |
| 57 | + "and", "del", "from", "not", "while", "as", "elif", "global", "or", "with", |
| 58 | + "assert", "else", "if", "pass", "yield", "break", "except", "import", |
| 59 | + "print", "class", "exec", "in", "raise", "continue", "finally", "is", |
| 60 | + "return", "def", "for", "lambda", "try")); |
| 61 | + |
54 | 62 | supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
55 | 63 | supportingFiles.add(new SupportingFile("swagger.mustache", module, "swagger.py"));
|
56 | 64 | supportingFiles.add(new SupportingFile("__init__.mustache", module, "__init__.py"));
|
|
0 commit comments