[Kotlin] fix wrong type- and importMapping for kotlinx.date (#17597) (#18488)

This commit is contained in:
Alexander Karkossa 2024-04-24 17:42:57 +02:00 committed by GitHub
parent fbe2e0b18f
commit 50945d0e17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -578,9 +578,14 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
private void processKotlinxDate() { private void processKotlinxDate() {
additionalProperties.put(DateLibrary.KOTLINX_DATETIME.value, true); additionalProperties.put(DateLibrary.KOTLINX_DATETIME.value, true);
typeMapping.put("date-time", "kotlinx.datetime.Instant"); typeMapping.put("date-time", "Instant");
typeMapping.put("date", "LocalDate");
typeMapping.put("DateTime", "Instant"); typeMapping.put("DateTime", "Instant");
typeMapping.put("Date", "LocalDate");
importMapping.put("Instant", "kotlinx.datetime.Instant"); importMapping.put("Instant", "kotlinx.datetime.Instant");
importMapping.put("LocalDate", "kotlinx.datetime.LocalDate");
} }
private void processJVMRetrofit2Library(String infrastructureFolder) { private void processJVMRetrofit2Library(String infrastructureFolder) {