forked from loafle/openapi-generator-original
[Kotlin][okhttp] replace okhttpclient with callfactory (#19422)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import java.io.IOException
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Call
|
||||
import okhttp3.HttpUrl
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.openapitools.client.infrastructure.ResponseType
|
||||
import org.openapitools.client.infrastructure.Success
|
||||
import org.openapitools.client.infrastructure.toMultiValue
|
||||
|
||||
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
|
||||
class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.squareup.moshi.adapter
|
||||
|
||||
val EMPTY_REQUEST: RequestBody = ByteArray(0).toRequestBody()
|
||||
|
||||
open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClient) {
|
||||
open class ApiClient(val baseUrl: String, val client: Call.Factory = defaultClient) {
|
||||
companion object {
|
||||
protected const val ContentType = "Content-Type"
|
||||
protected const val Accept = "Accept"
|
||||
|
||||
Reference in New Issue
Block a user