diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 8960b2f8e696..ebbe0eacca07 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -541,10 +541,12 @@ public Map postProcessModelsEnum(Map objs) { .forEach(cm -> { cm.imports.add(importMapping.get("JsonValue")); cm.imports.add(importMapping.get("JsonProperty")); - Map item = new HashMap<>(); - item.put("import", importMapping.get("JsonValue")); - item.put("import", importMapping.get("JsonProperty")); - imports.add(item); + Map itemJsonValue = new HashMap<>(); + itemJsonValue.put("import", importMapping.get("JsonValue")); + imports.add(itemJsonValue); + Map itemJsonProperty = new HashMap<>(); + itemJsonProperty.put("import", importMapping.get("JsonProperty")); + imports.add(itemJsonProperty); }); return objs;