avoid intersection type (#21378)

avoid intersection type by splitting the statements into separate code-branches. for each branch the type of `value` is therefor no longer an intersection

Fixes https://github.com/OpenAPITools/openapi-generator/issues/20636
This commit is contained in:
Nicklas Utgaard
2025-06-04 21:48:11 +02:00
committed by GitHub
parent eb8ce7331a
commit 89eea742fe
25 changed files with 125 additions and 50 deletions

View File

@@ -365,8 +365,11 @@ open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClie
null -> ""
is Array<*> -> toMultiValue(value, "csv").toString()
is Iterable<*> -> toMultiValue(value, "csv").toString()
is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime ->
parseDateToQueryString(value)
is OffsetDateTime -> parseDateToQueryString(value)
is OffsetTime -> parseDateToQueryString(value)
is LocalDateTime -> parseDateToQueryString(value)
is LocalDate -> parseDateToQueryString(value)
is LocalTime -> parseDateToQueryString(value)
else -> value.toString()
}