Skip to content

Commit 15b228c

Browse files
authored
fix import mapping for JsonValue (#11216)
1 parent 6397421 commit 15b228c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -541,10 +541,12 @@ public Map<String, Object> postProcessModelsEnum(Map<String, Object> objs) {
541541
.forEach(cm -> {
542542
cm.imports.add(importMapping.get("JsonValue"));
543543
cm.imports.add(importMapping.get("JsonProperty"));
544-
Map<String, String> item = new HashMap<>();
545-
item.put("import", importMapping.get("JsonValue"));
546-
item.put("import", importMapping.get("JsonProperty"));
547-
imports.add(item);
544+
Map<String, String> itemJsonValue = new HashMap<>();
545+
itemJsonValue.put("import", importMapping.get("JsonValue"));
546+
imports.add(itemJsonValue);
547+
Map<String, String> itemJsonProperty = new HashMap<>();
548+
itemJsonProperty.put("import", importMapping.get("JsonProperty"));
549+
imports.add(itemJsonProperty);
548550
});
549551

550552
return objs;

0 commit comments

Comments
 (0)