forked from loafle/openapi-generator-original
Avoid the importPath field
This commit is contained in:
parent
792059f195
commit
312f1c6f25
@ -7,7 +7,7 @@ import java.util.*;
|
||||
|
||||
public class CodegenModel {
|
||||
public String parent;
|
||||
public String name, classname, importPath, description, classVarName, modelJson;
|
||||
public String name, classname, description, classVarName, modelJson;
|
||||
public String defaultValue;
|
||||
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
|
||||
public Set<String> imports = new HashSet<String>();
|
||||
|
@ -428,7 +428,6 @@ public class DefaultCodegen {
|
||||
m.name = name;
|
||||
m.description = escapeText(model.getDescription());
|
||||
m.classname = toModelName(name);
|
||||
m.importPath = toModelImport(name);
|
||||
m.classVarName = toVarName(name);
|
||||
m.modelJson = Json.pretty(model);
|
||||
m.externalDocs = model.getExternalDocs();
|
||||
|
@ -428,6 +428,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
|
||||
CodegenModel cm = config.fromModel(key, mm);
|
||||
Map<String, Object> mo = new HashMap<String, Object>();
|
||||
mo.put("model", cm);
|
||||
mo.put("importPath", config.toModelImport(key));
|
||||
models.add(mo);
|
||||
allImports.addAll(cm.imports);
|
||||
}
|
||||
|
@ -9,9 +9,7 @@ require '{{gemName}}/swagger/version'
|
||||
# Models
|
||||
require '{{modelPackage}}/base_object'
|
||||
{{#models}}
|
||||
{{#model}}
|
||||
require '{{importPath}}'
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
||||
# APIs
|
||||
|
Loading…
x
Reference in New Issue
Block a user