forked from loafle/openapi-generator-original
updated script, addressed #189 with type mapping
This commit is contained in:
parent
dfc7750dda
commit
db5259b913
@ -18,7 +18,10 @@ package com.wordnik.swagger.codegen.languages;
|
||||
import com.wordnik.swagger.codegen.*;
|
||||
import com.wordnik.swagger.models.properties.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
String module = "client";
|
||||
|
||||
public String getName() {
|
||||
return "python";
|
||||
@ -35,8 +38,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
apiTemplateFiles.put("api.mustache", ".py");
|
||||
templateDir = "python";
|
||||
|
||||
apiPackage = "";
|
||||
modelPackage = "models";
|
||||
apiPackage = module;
|
||||
modelPackage = module + ".models";
|
||||
|
||||
languageSpecificPrimitives.clear();
|
||||
languageSpecificPrimitives.add("int");
|
||||
@ -59,10 +62,9 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
typeMapping.put("date", "datetime");
|
||||
|
||||
|
||||
supportingFiles.add(new SupportingFile("swagger.mustache", "", "swagger.py"));
|
||||
supportingFiles.add(new SupportingFile("__init__.mustache", "", "__init__.py"));
|
||||
supportingFiles.add(new SupportingFile("__init__.mustache", modelPackage, "__init__.py"));
|
||||
|
||||
supportingFiles.add(new SupportingFile("swagger.mustache", module, "swagger.py"));
|
||||
supportingFiles.add(new SupportingFile("__init__.mustache", module, "__init__.py"));
|
||||
supportingFiles.add(new SupportingFile("__init__.mustache", modelPackage.replaceAll("\\.", File.separator), "__init__.py"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user