File tree Expand file tree Collapse file tree 33 files changed +233
-33
lines changed
modules/openapi-generator/src/main/resources/kotlin-client
libraries/jvm-retrofit2/infrastructure
kotlin/src/main/kotlin/org/openapitools/client/apis
kotlin-gson/src/main/kotlin/org/openapitools/client/apis
kotlin-jackson/src/main/kotlin/org/openapitools/client/apis
kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis
kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis
kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis
kotlin-nullable/src/main/kotlin/org/openapitools/client/apis
kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis
kotlin-retrofit2/src/main/kotlin/org/openapitools/client/infrastructure
kotlin-string/src/main/kotlin/org/openapitools/client/apis
kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis Expand file tree Collapse file tree 33 files changed +233
-33
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,13 @@ import {{packageName}}.infrastructure.Success
17
17
import { {packageName} }.infrastructure.toMultiValue
18
18
19
19
{ {#operations} }
20
- { {#nonPublicApi} }internal { {/nonPublicApi} }class { {classname} }(basePath: kotlin.String = "{ {{basePath} }}") : ApiClient(basePath) {
20
+ { {#nonPublicApi} }internal { {/nonPublicApi} }class { {classname} }(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
21
+ companion object {
22
+ @JvmStatic
23
+ val defaultBasePath: String by lazy {
24
+ System.getProperties().getProperty(" {{packageName}}.baseUrl" , " {{{basePath}}}" )
25
+ }
26
+ }
21
27
22
28
{ {#operation} }
23
29
/**
Original file line number Diff line number Diff line change @@ -11,9 +11,16 @@ import retrofit2.converter.moshi.MoshiConverterFactory
11
11
{ {/moshi} }
12
12
13
13
{ {#nonPublicApi} }internal { {/nonPublicApi} }class ApiClient(
14
- private var baseUrl: String = " { {{basePath } }}" ,
14
+ private var baseUrl: String = defaultBasePath ,
15
15
private var okHttpClient: OkHttpClient
16
16
) {
17
+ companion object {
18
+ @JvmStatic
19
+ val defaultBasePath: String by lazy {
20
+ System.getProperties().getProperty(" {{packageName}}.baseUrl" , " {{{basePath}}}" )
21
+ }
22
+ }
23
+
17
24
init {
18
25
normalizeBaseUrl()
19
26
}
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- internal class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ internal class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- internal class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ internal class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- internal class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ internal class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class UserApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class UserApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Create user
Original file line number Diff line number Diff line change @@ -6,9 +6,16 @@ import retrofit2.converter.scalars.ScalarsConverterFactory
6
6
import retrofit2.converter.moshi.MoshiConverterFactory
7
7
8
8
class ApiClient (
9
- private var baseUrl : String = " http://petstore.swagger.io/v2 " ,
9
+ private var baseUrl : String = defaultBasePath ,
10
10
private var okHttpClient : OkHttpClient
11
11
) {
12
+ companion object {
13
+ @JvmStatic
14
+ val defaultBasePath: String by lazy {
15
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
16
+ }
17
+ }
18
+
12
19
init {
13
20
normalizeBaseUrl()
14
21
}
Original file line number Diff line number Diff line change @@ -26,7 +26,13 @@ import org.openapitools.client.infrastructure.ResponseType
26
26
import org.openapitools.client.infrastructure.Success
27
27
import org.openapitools.client.infrastructure.toMultiValue
28
28
29
- class PetApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
29
+ class PetApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
30
+ companion object {
31
+ @JvmStatic
32
+ val defaultBasePath: String by lazy {
33
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
34
+ }
35
+ }
30
36
31
37
/* *
32
38
* Add a new pet to the store
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ import org.openapitools.client.infrastructure.ResponseType
25
25
import org.openapitools.client.infrastructure.Success
26
26
import org.openapitools.client.infrastructure.toMultiValue
27
27
28
- class StoreApi (basePath : kotlin.String = " http://petstore.swagger.io/v2" ) : ApiClient(basePath) {
28
+ class StoreApi (basePath : kotlin.String = defaultBasePath) : ApiClient(basePath) {
29
+ companion object {
30
+ @JvmStatic
31
+ val defaultBasePath: String by lazy {
32
+ System .getProperties().getProperty(" org.openapitools.client.baseUrl" , " http://petstore.swagger.io/v2" )
33
+ }
34
+ }
29
35
30
36
/* *
31
37
* Delete purchase order by ID
You can’t perform that action at this time.
0 commit comments