Skip to content

Commit 50945d0

Browse files
authored
[Kotlin] fix wrong type- and importMapping for kotlinx.date (#17597) (#18488)
1 parent fbe2e0b commit 50945d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,14 @@ private void processJava8Date(String dateLibrary) {
578578
private void processKotlinxDate() {
579579
additionalProperties.put(DateLibrary.KOTLINX_DATETIME.value, true);
580580

581-
typeMapping.put("date-time", "kotlinx.datetime.Instant");
581+
typeMapping.put("date-time", "Instant");
582+
typeMapping.put("date", "LocalDate");
583+
582584
typeMapping.put("DateTime", "Instant");
585+
typeMapping.put("Date", "LocalDate");
586+
583587
importMapping.put("Instant", "kotlinx.datetime.Instant");
588+
importMapping.put("LocalDate", "kotlinx.datetime.LocalDate");
584589
}
585590

586591
private void processJVMRetrofit2Library(String infrastructureFolder) {

0 commit comments

Comments
 (0)