forked from loafle/openapi-generator-original
fixed import types
This commit is contained in:
parent
461cb51f6a
commit
e2ae99acac
@ -648,7 +648,7 @@ public class DefaultCodegen {
|
|||||||
collectionFormat = qp.getCollectionFormat();
|
collectionFormat = qp.getCollectionFormat();
|
||||||
CodegenProperty pr = fromProperty("inner", inner);
|
CodegenProperty pr = fromProperty("inner", inner);
|
||||||
p.baseType = pr.datatype;
|
p.baseType = pr.datatype;
|
||||||
imports.add(pr.datatype);
|
imports.add(pr.baseType);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
property = PropertyBuilder.build(qp.getType(), qp.getFormat(), null);
|
property = PropertyBuilder.build(qp.getType(), qp.getFormat(), null);
|
||||||
@ -657,8 +657,9 @@ public class DefaultCodegen {
|
|||||||
p.dataType = model.datatype;
|
p.dataType = model.datatype;
|
||||||
p.paramName = toParamName(qp.getName());
|
p.paramName = toParamName(qp.getName());
|
||||||
|
|
||||||
if(model.complexType != null)
|
if(model.complexType != null) {
|
||||||
imports.add(model.complexType);
|
imports.add(model.complexType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BodyParameter bp = (BodyParameter) param;
|
BodyParameter bp = (BodyParameter) param;
|
||||||
@ -668,7 +669,6 @@ public class DefaultCodegen {
|
|||||||
ModelImpl impl = (ModelImpl) model;
|
ModelImpl impl = (ModelImpl) model;
|
||||||
CodegenModel cm = fromModel(bp.getName(), impl);
|
CodegenModel cm = fromModel(bp.getName(), impl);
|
||||||
p.dataType = getTypeDeclaration(cm.classname);
|
p.dataType = getTypeDeclaration(cm.classname);
|
||||||
System.out.println("added import for " + p.dataType);
|
|
||||||
imports.add(p.dataType);
|
imports.add(p.dataType);
|
||||||
}
|
}
|
||||||
else if(model instanceof ArrayModel) {
|
else if(model instanceof ArrayModel) {
|
||||||
@ -679,6 +679,7 @@ public class DefaultCodegen {
|
|||||||
// get the single property
|
// get the single property
|
||||||
ArrayProperty ap = new ArrayProperty().items(impl.getItems());
|
ArrayProperty ap = new ArrayProperty().items(impl.getItems());
|
||||||
CodegenProperty cp = fromProperty("inner", ap);
|
CodegenProperty cp = fromProperty("inner", ap);
|
||||||
|
|
||||||
imports.add(cp.baseType);
|
imports.add(cp.baseType);
|
||||||
p.dataType = cp.datatype;
|
p.dataType = cp.datatype;
|
||||||
p.isContainer = true;
|
p.isContainer = true;
|
||||||
@ -691,8 +692,9 @@ public class DefaultCodegen {
|
|||||||
name = typeMapping.get(name);
|
name = typeMapping.get(name);
|
||||||
else {
|
else {
|
||||||
name = toModelName(name);
|
name = toModelName(name);
|
||||||
if(defaultIncludes.contains(name))
|
if(defaultIncludes.contains(name)) {
|
||||||
imports.add(name);
|
imports.add(name);
|
||||||
|
}
|
||||||
name = getTypeDeclaration(name);
|
name = getTypeDeclaration(name);
|
||||||
}
|
}
|
||||||
p.dataType = name;
|
p.dataType = name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user