forked from loafle/openapi-generator-original
import time when properties are slices of time.Time (#3973)
This commit is contained in:
parent
9ae49db670
commit
af9eb8d7da
@ -495,7 +495,8 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
if (v instanceof CodegenModel) {
|
||||
CodegenModel model = (CodegenModel) v;
|
||||
for (CodegenProperty param : model.vars) {
|
||||
if (!addedTimeImport && "time.Time".equals(param.baseType)) {
|
||||
if (!addedTimeImport
|
||||
&& "time.Time".equals(param.dataType) || ("[]time.Time".equals(param.dataType))) {
|
||||
imports.add(createMapping("import", "time"));
|
||||
addedTimeImport = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user