Skip to content

Commit af9eb8d

Browse files
masciwing328
authored andcommitted
import time when properties are slices of time.Time (#3973)
1 parent 9ae49db commit af9eb8d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
495495
if (v instanceof CodegenModel) {
496496
CodegenModel model = (CodegenModel) v;
497497
for (CodegenProperty param : model.vars) {
498-
if (!addedTimeImport && "time.Time".equals(param.baseType)) {
498+
if (!addedTimeImport
499+
&& "time.Time".equals(param.dataType) || ("[]time.Time".equals(param.dataType))) {
499500
imports.add(createMapping("import", "time"));
500501
addedTimeImport = true;
501502
}

0 commit comments

Comments
 (0)