Skip to content

Commit

Permalink
import time when properties are slices of time.Time (OpenAPITools#3973)
Browse files Browse the repository at this point in the history
  • Loading branch information
masci authored and Jesse Michael committed Oct 3, 2019
1 parent e324963 commit 39e5520
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ public Map<String, Object> postProcessModels(Map<String, Object> objs) {
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;
}
Expand Down

0 comments on commit 39e5520

Please sign in to comment.