mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[Kotlin] update ApiClient to register all adapters for GsonBuilder (#18965)
* update api client to register type adapter * update samples * remove json array variable name
This commit is contained in:
@@ -17,7 +17,7 @@ class ApiClient(
|
||||
private var baseUrl: String = defaultBasePath,
|
||||
private val okHttpClientBuilder: OkHttpClient.Builder? = null,
|
||||
private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder,
|
||||
private val callFactory : Call.Factory? = null,
|
||||
private val callFactory: Call.Factory? = null,
|
||||
private val callAdapterFactories: List<CallAdapter.Factory> = listOf(
|
||||
),
|
||||
private val converterFactories: List<Converter.Factory> = listOf(
|
||||
@@ -92,7 +92,7 @@ class ApiClient(
|
||||
|
||||
private inline fun <T, reified U> Iterable<T>.runOnFirst(callback: U.() -> Unit) {
|
||||
for (element in this) {
|
||||
if (element is U) {
|
||||
if (element is U) {
|
||||
callback.invoke(element)
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user