forked from loafle/openapi-generator-original
[kotlin][client] add base url key (#10633)
* [kotlin][client] add base url key * [kotlin][client] update sample projects * [kotlin][client] add base url key
This commit is contained in:
parent
df260acc8f
commit
57afa97166
@ -27,7 +27,7 @@ import {{packageName}}.infrastructure.toMultiValue
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("{{packageName}}.baseUrl", "{{{basePath}}}")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "{{{basePath}}}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,7 @@ import com.squareup.moshi.adapter
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "{{packageName}}.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -324,9 +324,12 @@ import okhttp3.MediaType.Companion.toMediaType
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
protected val baseUrlKey = "{{packageName}}.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("{{packageName}}.baseUrl", "{{{basePath}}}")
|
||||
System.getProperties().getProperty(baseUrlKey, "{{{basePath}}}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://localhost")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://localhost")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -41,7 +41,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ internal open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -201,9 +201,12 @@ class ApiClient(
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
protected val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,9 +204,12 @@ class ApiClient(
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
protected val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -201,9 +201,12 @@ class ApiClient(
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
protected val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -38,7 +38,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
@ -39,7 +39,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath)
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
val defaultBasePath: String by lazy {
|
||||
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2")
|
||||
System.getProperties().getProperty(ApiClient.baseUrlKey, "http://petstore.swagger.io/v2")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,7 @@ open class ApiClient(val baseUrl: String) {
|
||||
var username: String? = null
|
||||
var password: String? = null
|
||||
var accessToken: String? = null
|
||||
const val baseUrlKey = "org.openapitools.client.baseUrl"
|
||||
|
||||
@JvmStatic
|
||||
val client: OkHttpClient by lazy {
|
||||
|
Loading…
x
Reference in New Issue
Block a user