[kotlin] fix Date types usages (#8594)

* [kotlin] fix Date types usages
This commit is contained in:
Bruno Coelho 2021-02-03 01:55:51 +00:00 committed by GitHub
parent b78d4fce6a
commit 45fc02350b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
151 changed files with 660 additions and 790 deletions

View File

@ -32,8 +32,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
|BigDecimal|java.math.BigDecimal|
|Date|java.util.Date|
|DateTime|java.time.LocalDateTime|
|Date|java.time.LocalDate|
|DateTime|java.time.OffsetDateTime|
|File|java.io.File|
|LocalDate|java.time.LocalDate|
|LocalDateTime|java.time.LocalDateTime|

View File

@ -26,8 +26,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
|BigDecimal|java.math.BigDecimal|
|Date|java.util.Date|
|DateTime|java.time.LocalDateTime|
|Date|java.time.LocalDate|
|DateTime|java.time.OffsetDateTime|
|File|java.io.File|
|LocalDate|java.time.LocalDate|
|LocalDateTime|java.time.LocalDateTime|

View File

@ -34,8 +34,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
|BigDecimal|java.math.BigDecimal|
|Date|java.util.Date|
|DateTime|java.time.LocalDateTime|
|Date|java.time.LocalDate|
|DateTime|java.time.OffsetDateTime|
|File|java.io.File|
|LocalDate|java.time.LocalDate|
|LocalDateTime|java.time.LocalDateTime|

View File

@ -27,8 +27,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Imports |
| ---------- | ------- |
|BigDecimal|java.math.BigDecimal|
|Date|java.util.Date|
|DateTime|java.time.LocalDateTime|
|Date|java.time.LocalDate|
|DateTime|java.time.OffsetDateTime|
|File|java.io.File|
|LocalDate|java.time.LocalDate|
|LocalDateTime|java.time.LocalDateTime|

View File

@ -153,7 +153,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
typeMapping.put("ByteArray", "kotlin.ByteArray");
typeMapping.put("number", "java.math.BigDecimal");
typeMapping.put("decimal", "java.math.BigDecimal");
typeMapping.put("date-time", "java.time.LocalDateTime");
typeMapping.put("date-time", "java.time.OffsetDateTime");
typeMapping.put("date", "java.time.LocalDate");
typeMapping.put("file", "java.io.File");
typeMapping.put("array", "kotlin.Array");
@ -163,7 +163,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
typeMapping.put("object", "kotlin.Any");
typeMapping.put("binary", "kotlin.ByteArray");
typeMapping.put("Date", "java.time.LocalDate");
typeMapping.put("DateTime", "java.time.LocalDateTime");
typeMapping.put("DateTime", "java.time.OffsetDateTime");
instantiationTypes.put("array", "kotlin.collections.ArrayList");
instantiationTypes.put("list", "kotlin.collections.ArrayList");
@ -174,9 +174,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
importMapping.put("UUID", "java.util.UUID");
importMapping.put("URI", "java.net.URI");
importMapping.put("File", "java.io.File");
importMapping.put("Date", "java.util.Date");
importMapping.put("Date", "java.time.LocalDate");
importMapping.put("Timestamp", "java.sql.Timestamp");
importMapping.put("DateTime", "java.time.LocalDateTime");
importMapping.put("DateTime", "java.time.OffsetDateTime");
importMapping.put("LocalDateTime", "java.time.LocalDateTime");
importMapping.put("LocalDate", "java.time.LocalDate");
importMapping.put("LocalTime", "java.time.LocalTime");

View File

@ -125,17 +125,9 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
typeMapping.put("array", "kotlin.collections.List");
typeMapping.put("list", "kotlin.collections.List");
typeMapping.put("date", "java.time.LocalDate");
typeMapping.put("date-time", "java.time.OffsetDateTime");
typeMapping.put("Date", "java.time.LocalDate");
typeMapping.put("DateTime", "java.time.OffsetDateTime");
// use resource for file handling
typeMapping.put("file", "org.springframework.core.io.Resource");
importMapping.put("Date", "java.time.LocalDate");
importMapping.put("DateTime", "java.time.OffsetDateTime");
addOption(TITLE, "server title name or client service name", title);
addOption(BASE_PACKAGE, "base package (invokerPackage) for generated code", basePackage);
addOption(SERVER_PORT, "configuration the port in which the sever is to run on", serverPort);

View File

@ -2,7 +2,6 @@ package {{packageName}}.infrastructure
{{#moshi}}
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
{{^moshiCodeGen}}
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
{{/moshiCodeGen}}
@ -36,7 +35,6 @@ import java.util.Date
{{#moshi}}
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())
@ -54,7 +52,6 @@ import java.util.Date
{{#gson}}
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())

View File

@ -11,7 +11,6 @@ import java.util.Date
object Serializer {
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -11,7 +11,6 @@ import java.util.Date
object Serializer {
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())

View File

@ -1,13 +1,11 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
internal object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1 +1 @@
5.0.0-SNAPSHOT
5.0.1-SNAPSHOT

View File

@ -33,6 +33,5 @@ dependencies {
compile "com.squareup.moshi:moshi-kotlin:1.9.2"
compile "com.squareup.moshi:moshi-adapters:1.9.2"
compile "com.squareup.okhttp3:okhttp:4.2.2"
compile "com.squareup.okhttp3:logging-interceptor:4.4.0"
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
}

View File

@ -10,6 +10,7 @@ val Response.isInformational : Boolean get() = this.code in 100..199
/**
* Provides an extension to evaluation whether the response is a 3xx code
*/
@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
val Response.isRedirect : Boolean get() = this.code in 300..399
/**

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -1,14 +1,12 @@
package org.openapitools.client.infrastructure
import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import java.util.Date
object Serializer {
@JvmStatic
val moshiBuilder: Moshi.Builder = Moshi.Builder()
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
.add(OffsetDateTimeAdapter())
.add(LocalDateTimeAdapter())
.add(LocalDateAdapter())

View File

@ -27,12 +27,6 @@ docs/Foo.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
@ -100,12 +94,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt
src/main/kotlin/org/openapitools/client/models/FormatTest.kt
src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt
src/main/kotlin/org/openapitools/client/models/InlineObject.kt
src/main/kotlin/org/openapitools/client/models/InlineObject1.kt
src/main/kotlin/org/openapitools/client/models/InlineObject2.kt
src/main/kotlin/org/openapitools/client/models/InlineObject3.kt
src/main/kotlin/org/openapitools/client/models/InlineObject4.kt
src/main/kotlin/org/openapitools/client/models/InlineObject5.kt
src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
src/main/kotlin/org/openapitools/client/models/List.kt
src/main/kotlin/org/openapitools/client/models/MapTest.kt

View File

@ -101,12 +101,6 @@ Class | Method | HTTP request | Description
- [org.openapitools.client.models.FormatTest](docs/FormatTest.md)
- [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md)
- [org.openapitools.client.models.InlineObject](docs/InlineObject.md)
- [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md)
- [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md)
- [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md)
- [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md)
- [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md)
- [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md)
- [org.openapitools.client.models.List](docs/List.md)
- [org.openapitools.client.models.MapTest](docs/MapTest.md)

View File

@ -30,8 +30,9 @@ test {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0"
compile "com.google.code.gson:gson:2.8.6"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0"
compile "com.squareup.okhttp3:logging-interceptor:4.4.0"
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
compile "com.squareup.retrofit2:converter-gson:$retrofitVersion"
compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion"

View File

@ -460,13 +460,13 @@ To test enum parameters
val apiClient = ApiClient()
val webService = apiClient.createWebservice(FakeApi::class.java)
val enumHeaderStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Header parameter enum test (string array)
val enumHeaderStringArray : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Header parameter enum test (string array)
val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string)
val enumQueryStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Query parameter enum test (string array)
val enumQueryStringArray : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Query parameter enum test (string array)
val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string)
val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double)
val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double)
val enumFormStringArray : kotlin.Array<kotlin.String> = enumFormStringArray_example // kotlin.Array<kotlin.String> | Form parameter enum test (string array)
val enumFormStringArray : kotlin.collections.List<kotlin.String> = enumFormStringArray_example // kotlin.collections.List<kotlin.String> | Form parameter enum test (string array)
val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string)
launch(Dispatchers.IO) {
@ -478,14 +478,14 @@ launch(Dispatchers.IO) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumHeaderStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2]
**enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
**enumFormStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to &quot;$&quot;] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumFormStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
### Return type
@ -645,11 +645,11 @@ To test the collection format in query parameters
val apiClient = ApiClient()
val webService = apiClient.createWebservice(FakeApi::class.java)
val pipe : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val ioutil : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val http : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val url : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val context : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val pipe : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val ioutil : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val http : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val url : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val context : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
launch(Dispatchers.IO) {
webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
@ -660,11 +660,11 @@ launch(Dispatchers.IO) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**pipe** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
### Return type

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**int64** | **kotlin.Long** | | [optional]
**float** | **kotlin.Float** | | [optional]
**double** | **kotlin.Double** | | [optional]
**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**string** | **kotlin.String** | | [optional]
**binary** | [**java.io.File**](java.io.File.md) | | [optional]
**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**&#x60;123minusList&#x60;** | **kotlin.String** | | [optional]
**&#x60;123list&#x60;** | **kotlin.String** | | [optional]

View File

@ -107,10 +107,10 @@ Multiple status values can be provided with comma separated strings
val apiClient = ApiClient()
val webService = apiClient.createWebservice(PetApi::class.java)
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
launch(Dispatchers.IO) {
val result : kotlin.Array<Pet> = webService.findPetsByStatus(status)
val result : kotlin.collections.List<Pet> = webService.findPetsByStatus(status)
}
```
@ -118,11 +118,11 @@ launch(Dispatchers.IO) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
**status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
@ -147,10 +147,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
val apiClient = ApiClient()
val webService = apiClient.createWebservice(PetApi::class.java)
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by
val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
launch(Dispatchers.IO) {
val result : kotlin.Array<Pet> = webService.findPetsByTags(tags)
val result : kotlin.collections.List<Pet> = webService.findPetsByTags(tags)
}
```
@ -158,11 +158,11 @@ launch(Dispatchers.IO) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
**tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional]
**dollarSpecialPropertyName** | **kotlin.Long** | | [optional]

View File

@ -66,7 +66,7 @@ Creates list of users with given input array
val apiClient = ApiClient()
val webService = apiClient.createWebservice(UserApi::class.java)
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
launch(Dispatchers.IO) {
webService.createUsersWithArrayInput(user)
@ -77,7 +77,7 @@ launch(Dispatchers.IO) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type
@ -104,7 +104,7 @@ Creates list of users with given input array
val apiClient = ApiClient()
val webService = apiClient.createWebservice(UserApi::class.java)
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
launch(Dispatchers.IO) {
webService.createUsersWithListInput(user)
@ -115,7 +115,7 @@ launch(Dispatchers.IO) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type

View File

@ -15,7 +15,7 @@ interface AnotherFakeApi {
* - 200: successful operation
*
* @param client client model
* @return [Client]
* @return [Client]
*/
@PATCH("another-fake/dummy")
suspend fun call123testSpecialTags(@Body client: Client): Response<Client>

View File

@ -14,7 +14,7 @@ interface DefaultApi {
* Responses:
* - 0: response
*
* @return [InlineResponseDefault]
* @return [InlineResponseDefault]
*/
@GET("foo")
suspend fun fooGet(): Response<InlineResponseDefault>

View File

@ -12,6 +12,8 @@ import org.openapitools.client.models.OuterComposite
import org.openapitools.client.models.Pet
import org.openapitools.client.models.User
import okhttp3.MultipartBody
interface FakeApi {
/**
* Health check endpoint
@ -19,7 +21,7 @@ interface FakeApi {
* Responses:
* - 200: The instance started successfully
*
* @return [HealthCheckResult]
* @return [HealthCheckResult]
*/
@GET("fake/health")
suspend fun fakeHealthGet(): Response<HealthCheckResult>
@ -33,10 +35,10 @@ interface FakeApi {
* @param pet Pet object that needs to be added to the store
* @param query1 query parameter (optional)
* @param header1 header parameter (optional)
* @return [Unit]
* @return [Unit]
*/
@GET("fake/http-signature-test")
suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Response<Unit>
suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String? = null, @Header("header_1") header1: kotlin.String): Response<Unit>
/**
*
@ -45,7 +47,7 @@ interface FakeApi {
* - 200: Output boolean
*
* @param body Input boolean as post body (optional)
* @return [kotlin.Boolean]
* @return [kotlin.Boolean]
*/
@POST("fake/outer/boolean")
suspend fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean? = null): Response<kotlin.Boolean>
@ -57,7 +59,7 @@ interface FakeApi {
* - 200: Output composite
*
* @param outerComposite Input composite as post body (optional)
* @return [OuterComposite]
* @return [OuterComposite]
*/
@POST("fake/outer/composite")
suspend fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite? = null): Response<OuterComposite>
@ -69,7 +71,7 @@ interface FakeApi {
* - 200: Output number
*
* @param body Input number as post body (optional)
* @return [java.math.BigDecimal]
* @return [java.math.BigDecimal]
*/
@POST("fake/outer/number")
suspend fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal? = null): Response<java.math.BigDecimal>
@ -81,7 +83,7 @@ interface FakeApi {
* - 200: Output string
*
* @param body Input string as post body (optional)
* @return [kotlin.String]
* @return [kotlin.String]
*/
@POST("fake/outer/string")
suspend fun fakeOuterStringSerialize(@Body body: kotlin.String? = null): Response<kotlin.String>
@ -93,7 +95,7 @@ interface FakeApi {
* - 200: Success
*
* @param fileSchemaTestClass
* @return [Unit]
* @return [Unit]
*/
@PUT("fake/body-with-file-schema")
suspend fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Response<Unit>
@ -106,7 +108,7 @@ interface FakeApi {
*
* @param query
* @param user
* @return [Unit]
* @return [Unit]
*/
@PUT("fake/body-with-query-params")
suspend fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Response<Unit>
@ -118,7 +120,7 @@ interface FakeApi {
* - 200: successful operation
*
* @param client client model
* @return [Client]
* @return [Client]
*/
@PATCH("fake")
suspend fun testClientModel(@Body client: Client): Response<Client>
@ -144,7 +146,7 @@ interface FakeApi {
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return [Unit]
* @return [Unit]
*/
@FormUrlEncoded
@POST("fake")
@ -158,18 +160,18 @@ interface FakeApi {
* - 404: Not found
*
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg")
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to "-efg")
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$")
* @param enumFormString Form parameter enum test (string) (optional, default to "-efg")
* @return [Unit]
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @return [Unit]
*/
@FormUrlEncoded
@GET("fake")
suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array<kotlin.String>, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Response<Unit>
suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.collections.List<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.collections.List<kotlin.String>? = null, @Query("enum_query_string") enumQueryString: kotlin.String? = null, @Query("enum_query_integer") enumQueryInteger: kotlin.Int? = null, @Query("enum_query_double") enumQueryDouble: kotlin.Double? = null, @Field("enum_form_string_array") enumFormStringArray: kotlin.collections.List<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Response<Unit>
/**
* Fake endpoint to test group parameters (optional)
@ -183,10 +185,10 @@ interface FakeApi {
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @return [Unit]
* @return [Unit]
*/
@DELETE("fake")
suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Response<Unit>
suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int? = null, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long? = null): Response<Unit>
/**
* test inline additionalProperties
@ -195,7 +197,7 @@ interface FakeApi {
* - 200: successful operation
*
* @param requestBody request body
* @return [Unit]
* @return [Unit]
*/
@POST("fake/inline-additionalProperties")
suspend fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map<kotlin.String, kotlin.String>): Response<Unit>
@ -208,7 +210,7 @@ interface FakeApi {
*
* @param param field1
* @param param2 field2
* @return [Unit]
* @return [Unit]
*/
@FormUrlEncoded
@GET("fake/jsonFormData")
@ -225,9 +227,9 @@ interface FakeApi {
* @param http
* @param url
* @param context
* @return [Unit]
* @return [Unit]
*/
@PUT("fake/test-query-paramters")
suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array<kotlin.String>): Response<Unit>
suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.collections.List<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.collections.List<kotlin.String>): Response<Unit>
}

View File

@ -15,7 +15,7 @@ interface FakeClassnameTags123Api {
* - 200: successful operation
*
* @param client client model
* @return [Client]
* @return [Client]
*/
@PATCH("fake_classname_test")
suspend fun testClassname(@Body client: Client): Response<Client>

View File

@ -8,15 +8,18 @@ import okhttp3.RequestBody
import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import okhttp3.MultipartBody
interface PetApi {
/**
* Add a new pet to the store
*
* Responses:
* - 200: Successful operation
* - 405: Invalid input
*
* @param pet Pet object that needs to be added to the store
* @return [Unit]
* @return [Unit]
*/
@POST("pet")
suspend fun addPet(@Body pet: Pet): Response<Unit>
@ -25,11 +28,12 @@ interface PetApi {
* Deletes a pet
*
* Responses:
* - 200: Successful operation
* - 400: Invalid pet value
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return [Unit]
* @return [Unit]
*/
@DELETE("pet/{petId}")
suspend fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Response<Unit>
@ -42,10 +46,10 @@ interface PetApi {
* - 400: Invalid status value
*
* @param status Status values that need to be considered for filter
* @return [kotlin.Array<Pet>]
* @return [kotlin.collections.List<Pet>]
*/
@GET("pet/findByStatus")
suspend fun findPetsByStatus(@Query("status") status: CSVParams): Response<kotlin.Array<Pet>>
suspend fun findPetsByStatus(@Query("status") status: CSVParams): Response<kotlin.collections.List<Pet>>
/**
* Finds Pets by tags
@ -55,11 +59,11 @@ interface PetApi {
* - 400: Invalid tag value
*
* @param tags Tags to filter by
* @return [kotlin.Array<Pet>]
* @return [kotlin.collections.List<Pet>]
*/
@Deprecated("This api was deprecated")
@GET("pet/findByTags")
suspend fun findPetsByTags(@Query("tags") tags: CSVParams): Response<kotlin.Array<Pet>>
suspend fun findPetsByTags(@Query("tags") tags: CSVParams): Response<kotlin.collections.List<Pet>>
/**
* Find pet by ID
@ -70,7 +74,7 @@ interface PetApi {
* - 404: Pet not found
*
* @param petId ID of pet to return
* @return [Pet]
* @return [Pet]
*/
@GET("pet/{petId}")
suspend fun getPetById(@Path("petId") petId: kotlin.Long): Response<Pet>
@ -79,12 +83,13 @@ interface PetApi {
* Update an existing pet
*
* Responses:
* - 200: Successful operation
* - 400: Invalid ID supplied
* - 404: Pet not found
* - 405: Validation exception
*
* @param pet Pet object that needs to be added to the store
* @return [Unit]
* @return [Unit]
*/
@PUT("pet")
suspend fun updatePet(@Body pet: Pet): Response<Unit>
@ -93,12 +98,13 @@ interface PetApi {
* Updates a pet in the store with form data
*
* Responses:
* - 200: Successful operation
* - 405: Invalid input
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return [Unit]
* @return [Unit]
*/
@FormUrlEncoded
@POST("pet/{petId}")
@ -113,7 +119,7 @@ interface PetApi {
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return [ApiResponse]
* @return [ApiResponse]
*/
@Multipart
@POST("pet/{petId}/uploadImage")
@ -128,7 +134,7 @@ interface PetApi {
* @param petId ID of pet to update
* @param requiredFile file to upload
* @param additionalMetadata Additional data to pass to server (optional)
* @return [ApiResponse]
* @return [ApiResponse]
*/
@Multipart
@POST("fake/{petId}/uploadImageWithRequiredFile")

View File

@ -16,7 +16,7 @@ interface StoreApi {
* - 404: Order not found
*
* @param orderId ID of the order that needs to be deleted
* @return [Unit]
* @return [Unit]
*/
@DELETE("store/order/{order_id}")
suspend fun deleteOrder(@Path("order_id") orderId: kotlin.String): Response<Unit>
@ -27,7 +27,7 @@ interface StoreApi {
* Responses:
* - 200: successful operation
*
* @return [kotlin.collections.Map<kotlin.String, kotlin.Int>]
* @return [kotlin.collections.Map<kotlin.String, kotlin.Int>]
*/
@GET("store/inventory")
suspend fun getInventory(): Response<kotlin.collections.Map<kotlin.String, kotlin.Int>>
@ -41,7 +41,7 @@ interface StoreApi {
* - 404: Order not found
*
* @param orderId ID of pet that needs to be fetched
* @return [Order]
* @return [Order]
*/
@GET("store/order/{order_id}")
suspend fun getOrderById(@Path("order_id") orderId: kotlin.Long): Response<Order>
@ -54,7 +54,7 @@ interface StoreApi {
* - 400: Invalid Order
*
* @param order order placed for purchasing the pet
* @return [Order]
* @return [Order]
*/
@POST("store/order")
suspend fun placeOrder(@Body order: Order): Response<Order>

View File

@ -15,7 +15,7 @@ interface UserApi {
* - 0: successful operation
*
* @param user Created user object
* @return [Unit]
* @return [Unit]
*/
@POST("user")
suspend fun createUser(@Body user: User): Response<Unit>
@ -27,10 +27,10 @@ interface UserApi {
* - 0: successful operation
*
* @param user List of user object
* @return [Unit]
* @return [Unit]
*/
@POST("user/createWithArray")
suspend fun createUsersWithArrayInput(@Body user: kotlin.Array<User>): Response<Unit>
suspend fun createUsersWithArrayInput(@Body user: kotlin.collections.List<User>): Response<Unit>
/**
* Creates list of users with given input array
@ -39,10 +39,10 @@ interface UserApi {
* - 0: successful operation
*
* @param user List of user object
* @return [Unit]
* @return [Unit]
*/
@POST("user/createWithList")
suspend fun createUsersWithListInput(@Body user: kotlin.Array<User>): Response<Unit>
suspend fun createUsersWithListInput(@Body user: kotlin.collections.List<User>): Response<Unit>
/**
* Delete user
@ -52,7 +52,7 @@ interface UserApi {
* - 404: User not found
*
* @param username The name that needs to be deleted
* @return [Unit]
* @return [Unit]
*/
@DELETE("user/{username}")
suspend fun deleteUser(@Path("username") username: kotlin.String): Response<Unit>
@ -66,7 +66,7 @@ interface UserApi {
* - 404: User not found
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return [User]
* @return [User]
*/
@GET("user/{username}")
suspend fun getUserByName(@Path("username") username: kotlin.String): Response<User>
@ -80,7 +80,7 @@ interface UserApi {
*
* @param username The user name for login
* @param password The password for login in clear text
* @return [kotlin.String]
* @return [kotlin.String]
*/
@GET("user/login")
suspend fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Response<kotlin.String>
@ -91,7 +91,7 @@ interface UserApi {
* Responses:
* - 0: successful operation
*
* @return [Unit]
* @return [Unit]
*/
@GET("user/logout")
suspend fun logoutUser(): Response<Unit>
@ -105,7 +105,7 @@ interface UserApi {
*
* @param username name that need to be deleted
* @param user Updated user object
* @return [Unit]
* @return [Unit]
*/
@PUT("user/{username}")
suspend fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Response<Unit>

View File

@ -21,7 +21,8 @@ import retrofit2.converter.gson.GsonConverterFactory
class ApiClient(
private var baseUrl: String = defaultBasePath,
private val okHttpClientBuilder: OkHttpClient.Builder? = null,
private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder
private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
private val okHttpClient : OkHttpClient? = null
) {
private val apiAuthorizations = mutableMapOf<String, Interceptor>()
var logger: ((String) -> Unit)? = null
@ -72,7 +73,7 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
authName: String,
bearerToken: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setBearerToken(bearerToken)
@ -82,8 +83,8 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
username: String,
authName: String,
username: String,
password: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setCredentials(username, password)
@ -93,10 +94,10 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
clientId: String,
secret: String,
username: String,
authName: String,
clientId: String,
secret: String,
username: String,
password: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
getTokenEndPoint()
@ -224,7 +225,8 @@ class ApiClient(
}
fun <S> createService(serviceClass: Class<S>): S {
return retrofitBuilder.client(clientBuilder.build()).build().create(serviceClass)
val usedClient = this.okHttpClient ?: clientBuilder.build()
return retrofitBuilder.client(usedClient).build().create(serviceClass)
}
private fun normalizeBaseUrl() {
@ -242,10 +244,10 @@ class ApiClient(
}
}
companion object {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2")
}
}
}
}

View File

@ -11,7 +11,6 @@ import java.util.Date
object Serializer {
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())

View File

@ -26,6 +26,7 @@ import java.io.Serializable
* @param int64
* @param float
* @param double
* @param decimal
* @param string
* @param binary
* @param dateTime
@ -53,6 +54,8 @@ data class FormatTest (
val float: kotlin.Float? = null,
@SerializedName("double")
val double: kotlin.Double? = null,
@SerializedName("decimal")
val decimal: java.math.BigDecimal? = null,
@SerializedName("string")
val string: kotlin.String? = null,
@SerializedName("binary")

View File

@ -17,12 +17,12 @@ import java.io.Serializable
/**
*
* @param `123minusList`
* @param `123list`
*/
data class List (
@SerializedName("123-list")
val `123minusList`: kotlin.String? = null
val `123list`: kotlin.String? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 123

View File

@ -17,12 +17,12 @@ import java.io.Serializable
/**
*
* @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket
* @param dollarSpecialPropertyName
*/
data class SpecialModelname (
@SerializedName("\$special[property.name]")
val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null
val dollarSpecialPropertyName: kotlin.Long? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 123

View File

@ -27,12 +27,6 @@ docs/Foo.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
@ -100,12 +94,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt
src/main/kotlin/org/openapitools/client/models/FormatTest.kt
src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt
src/main/kotlin/org/openapitools/client/models/InlineObject.kt
src/main/kotlin/org/openapitools/client/models/InlineObject1.kt
src/main/kotlin/org/openapitools/client/models/InlineObject2.kt
src/main/kotlin/org/openapitools/client/models/InlineObject3.kt
src/main/kotlin/org/openapitools/client/models/InlineObject4.kt
src/main/kotlin/org/openapitools/client/models/InlineObject5.kt
src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
src/main/kotlin/org/openapitools/client/models/List.kt
src/main/kotlin/org/openapitools/client/models/MapTest.kt

View File

@ -1 +1 @@
5.0.0-SNAPSHOT
5.0.1-SNAPSHOT

View File

@ -101,12 +101,6 @@ Class | Method | HTTP request | Description
- [org.openapitools.client.models.FormatTest](docs/FormatTest.md)
- [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md)
- [org.openapitools.client.models.InlineObject](docs/InlineObject.md)
- [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md)
- [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md)
- [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md)
- [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md)
- [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md)
- [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md)
- [org.openapitools.client.models.List](docs/List.md)
- [org.openapitools.client.models.MapTest](docs/MapTest.md)

View File

@ -31,8 +31,9 @@ test {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0"
compile "com.google.code.gson:gson:2.8.6"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0"
compile "com.squareup.okhttp3:logging-interceptor:4.4.0"
compile "io.reactivex:rxjava:$rxJavaVersion"
compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion"
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"

View File

@ -440,13 +440,13 @@ To test enum parameters
val apiClient = ApiClient()
val webService = apiClient.createWebservice(FakeApi::class.java)
val enumHeaderStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Header parameter enum test (string array)
val enumHeaderStringArray : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Header parameter enum test (string array)
val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string)
val enumQueryStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Query parameter enum test (string array)
val enumQueryStringArray : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Query parameter enum test (string array)
val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string)
val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double)
val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double)
val enumFormStringArray : kotlin.Array<kotlin.String> = enumFormStringArray_example // kotlin.Array<kotlin.String> | Form parameter enum test (string array)
val enumFormStringArray : kotlin.collections.List<kotlin.String> = enumFormStringArray_example // kotlin.collections.List<kotlin.String> | Form parameter enum test (string array)
val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string)
webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
@ -456,14 +456,14 @@ webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQuery
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumHeaderStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2]
**enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
**enumFormStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to &quot;$&quot;] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumFormStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
### Return type
@ -617,11 +617,11 @@ To test the collection format in query parameters
val apiClient = ApiClient()
val webService = apiClient.createWebservice(FakeApi::class.java)
val pipe : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val ioutil : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val http : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val url : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val context : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val pipe : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val ioutil : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val http : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val url : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val context : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
```
@ -630,11 +630,11 @@ webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**pipe** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
### Return type

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**int64** | **kotlin.Long** | | [optional]
**float** | **kotlin.Float** | | [optional]
**double** | **kotlin.Double** | | [optional]
**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**string** | **kotlin.String** | | [optional]
**binary** | [**java.io.File**](java.io.File.md) | | [optional]
**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**&#x60;123minusList&#x60;** | **kotlin.String** | | [optional]
**&#x60;123list&#x60;** | **kotlin.String** | | [optional]

View File

@ -103,20 +103,20 @@ Multiple status values can be provided with comma separated strings
val apiClient = ApiClient()
val webService = apiClient.createWebservice(PetApi::class.java)
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
val result : kotlin.Array<Pet> = webService.findPetsByStatus(status)
val result : kotlin.collections.List<Pet> = webService.findPetsByStatus(status)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
**status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
@ -141,20 +141,20 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
val apiClient = ApiClient()
val webService = apiClient.createWebservice(PetApi::class.java)
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by
val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
val result : kotlin.Array<Pet> = webService.findPetsByTags(tags)
val result : kotlin.collections.List<Pet> = webService.findPetsByTags(tags)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
**tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional]
**dollarSpecialPropertyName** | **kotlin.Long** | | [optional]

View File

@ -64,7 +64,7 @@ Creates list of users with given input array
val apiClient = ApiClient()
val webService = apiClient.createWebservice(UserApi::class.java)
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
webService.createUsersWithArrayInput(user)
```
@ -73,7 +73,7 @@ webService.createUsersWithArrayInput(user)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type
@ -100,7 +100,7 @@ Creates list of users with given input array
val apiClient = ApiClient()
val webService = apiClient.createWebservice(UserApi::class.java)
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
webService.createUsersWithListInput(user)
```
@ -109,7 +109,7 @@ webService.createUsersWithListInput(user)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type

View File

@ -15,7 +15,7 @@ interface AnotherFakeApi {
* - 200: successful operation
*
* @param client client model
* @return [Call]<[Client]>
* @return [Call]<[Client]>
*/
@PATCH("another-fake/dummy")
fun call123testSpecialTags(@Body client: Client): Observable<Client>

View File

@ -14,7 +14,7 @@ interface DefaultApi {
* Responses:
* - 0: response
*
* @return [Call]<[InlineResponseDefault]>
* @return [Call]<[InlineResponseDefault]>
*/
@GET("foo")
fun fooGet(): Observable<InlineResponseDefault>

View File

@ -12,6 +12,8 @@ import org.openapitools.client.models.OuterComposite
import org.openapitools.client.models.Pet
import org.openapitools.client.models.User
import okhttp3.MultipartBody
interface FakeApi {
/**
* Health check endpoint
@ -19,7 +21,7 @@ interface FakeApi {
* Responses:
* - 200: The instance started successfully
*
* @return [Call]<[HealthCheckResult]>
* @return [Call]<[HealthCheckResult]>
*/
@GET("fake/health")
fun fakeHealthGet(): Observable<HealthCheckResult>
@ -33,10 +35,10 @@ interface FakeApi {
* @param pet Pet object that needs to be added to the store
* @param query1 query parameter (optional)
* @param header1 header parameter (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@GET("fake/http-signature-test")
fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Observable<Unit>
fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String? = null, @Header("header_1") header1: kotlin.String): Observable<Unit>
/**
*
@ -45,7 +47,7 @@ interface FakeApi {
* - 200: Output boolean
*
* @param body Input boolean as post body (optional)
* @return [Call]<[kotlin.Boolean]>
* @return [Call]<[kotlin.Boolean]>
*/
@POST("fake/outer/boolean")
fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean? = null): Observable<kotlin.Boolean>
@ -57,7 +59,7 @@ interface FakeApi {
* - 200: Output composite
*
* @param outerComposite Input composite as post body (optional)
* @return [Call]<[OuterComposite]>
* @return [Call]<[OuterComposite]>
*/
@POST("fake/outer/composite")
fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite? = null): Observable<OuterComposite>
@ -69,7 +71,7 @@ interface FakeApi {
* - 200: Output number
*
* @param body Input number as post body (optional)
* @return [Call]<[java.math.BigDecimal]>
* @return [Call]<[java.math.BigDecimal]>
*/
@POST("fake/outer/number")
fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal? = null): Observable<java.math.BigDecimal>
@ -81,7 +83,7 @@ interface FakeApi {
* - 200: Output string
*
* @param body Input string as post body (optional)
* @return [Call]<[kotlin.String]>
* @return [Call]<[kotlin.String]>
*/
@POST("fake/outer/string")
fun fakeOuterStringSerialize(@Body body: kotlin.String? = null): Observable<kotlin.String>
@ -93,7 +95,7 @@ interface FakeApi {
* - 200: Success
*
* @param fileSchemaTestClass
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("fake/body-with-file-schema")
fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Observable<Unit>
@ -106,7 +108,7 @@ interface FakeApi {
*
* @param query
* @param user
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("fake/body-with-query-params")
fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Observable<Unit>
@ -118,7 +120,7 @@ interface FakeApi {
* - 200: successful operation
*
* @param client client model
* @return [Call]<[Client]>
* @return [Call]<[Client]>
*/
@PATCH("fake")
fun testClientModel(@Body client: Client): Observable<Client>
@ -144,7 +146,7 @@ interface FakeApi {
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@POST("fake")
@ -158,18 +160,18 @@ interface FakeApi {
* - 404: Not found
*
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg")
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to "-efg")
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$")
* @param enumFormString Form parameter enum test (string) (optional, default to "-efg")
* @return [Call]<[Unit]>
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@GET("fake")
fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array<kotlin.String>, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Observable<Unit>
fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.collections.List<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.collections.List<kotlin.String>? = null, @Query("enum_query_string") enumQueryString: kotlin.String? = null, @Query("enum_query_integer") enumQueryInteger: kotlin.Int? = null, @Query("enum_query_double") enumQueryDouble: kotlin.Double? = null, @Field("enum_form_string_array") enumFormStringArray: kotlin.collections.List<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Observable<Unit>
/**
* Fake endpoint to test group parameters (optional)
@ -183,10 +185,10 @@ interface FakeApi {
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("fake")
fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Observable<Unit>
fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int? = null, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long? = null): Observable<Unit>
/**
* test inline additionalProperties
@ -195,7 +197,7 @@ interface FakeApi {
* - 200: successful operation
*
* @param requestBody request body
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("fake/inline-additionalProperties")
fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map<kotlin.String, kotlin.String>): Observable<Unit>
@ -208,7 +210,7 @@ interface FakeApi {
*
* @param param field1
* @param param2 field2
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@GET("fake/jsonFormData")
@ -225,9 +227,9 @@ interface FakeApi {
* @param http
* @param url
* @param context
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("fake/test-query-paramters")
fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array<kotlin.String>): Observable<Unit>
fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.collections.List<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.collections.List<kotlin.String>): Observable<Unit>
}

View File

@ -15,7 +15,7 @@ interface FakeClassnameTags123Api {
* - 200: successful operation
*
* @param client client model
* @return [Call]<[Client]>
* @return [Call]<[Client]>
*/
@PATCH("fake_classname_test")
fun testClassname(@Body client: Client): Observable<Client>

View File

@ -8,15 +8,18 @@ import rx.Observable
import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import okhttp3.MultipartBody
interface PetApi {
/**
* Add a new pet to the store
*
* Responses:
* - 200: Successful operation
* - 405: Invalid input
*
* @param pet Pet object that needs to be added to the store
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("pet")
fun addPet(@Body pet: Pet): Observable<Unit>
@ -25,11 +28,12 @@ interface PetApi {
* Deletes a pet
*
* Responses:
* - 200: Successful operation
* - 400: Invalid pet value
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("pet/{petId}")
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Observable<Unit>
@ -42,10 +46,10 @@ interface PetApi {
* - 400: Invalid status value
*
* @param status Status values that need to be considered for filter
* @return [Call]<[kotlin.Array<Pet>]>
* @return [Call]<[kotlin.collections.List<Pet>]>
*/
@GET("pet/findByStatus")
fun findPetsByStatus(@Query("status") status: CSVParams): Observable<kotlin.Array<Pet>>
fun findPetsByStatus(@Query("status") status: CSVParams): Observable<kotlin.collections.List<Pet>>
/**
* Finds Pets by tags
@ -55,11 +59,11 @@ interface PetApi {
* - 400: Invalid tag value
*
* @param tags Tags to filter by
* @return [Call]<[kotlin.Array<Pet>]>
* @return [Call]<[kotlin.collections.List<Pet>]>
*/
@Deprecated("This api was deprecated")
@GET("pet/findByTags")
fun findPetsByTags(@Query("tags") tags: CSVParams): Observable<kotlin.Array<Pet>>
fun findPetsByTags(@Query("tags") tags: CSVParams): Observable<kotlin.collections.List<Pet>>
/**
* Find pet by ID
@ -70,7 +74,7 @@ interface PetApi {
* - 404: Pet not found
*
* @param petId ID of pet to return
* @return [Call]<[Pet]>
* @return [Call]<[Pet]>
*/
@GET("pet/{petId}")
fun getPetById(@Path("petId") petId: kotlin.Long): Observable<Pet>
@ -79,12 +83,13 @@ interface PetApi {
* Update an existing pet
*
* Responses:
* - 200: Successful operation
* - 400: Invalid ID supplied
* - 404: Pet not found
* - 405: Validation exception
*
* @param pet Pet object that needs to be added to the store
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("pet")
fun updatePet(@Body pet: Pet): Observable<Unit>
@ -93,12 +98,13 @@ interface PetApi {
* Updates a pet in the store with form data
*
* Responses:
* - 200: Successful operation
* - 405: Invalid input
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@POST("pet/{petId}")
@ -113,7 +119,7 @@ interface PetApi {
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return [Call]<[ApiResponse]>
* @return [Call]<[ApiResponse]>
*/
@Multipart
@POST("pet/{petId}/uploadImage")
@ -128,7 +134,7 @@ interface PetApi {
* @param petId ID of pet to update
* @param requiredFile file to upload
* @param additionalMetadata Additional data to pass to server (optional)
* @return [Call]<[ApiResponse]>
* @return [Call]<[ApiResponse]>
*/
@Multipart
@POST("fake/{petId}/uploadImageWithRequiredFile")

View File

@ -16,7 +16,7 @@ interface StoreApi {
* - 404: Order not found
*
* @param orderId ID of the order that needs to be deleted
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("store/order/{order_id}")
fun deleteOrder(@Path("order_id") orderId: kotlin.String): Observable<Unit>
@ -27,7 +27,7 @@ interface StoreApi {
* Responses:
* - 200: successful operation
*
* @return [Call]<[kotlin.collections.Map<kotlin.String, kotlin.Int>]>
* @return [Call]<[kotlin.collections.Map<kotlin.String, kotlin.Int>]>
*/
@GET("store/inventory")
fun getInventory(): Observable<kotlin.collections.Map<kotlin.String, kotlin.Int>>
@ -41,7 +41,7 @@ interface StoreApi {
* - 404: Order not found
*
* @param orderId ID of pet that needs to be fetched
* @return [Call]<[Order]>
* @return [Call]<[Order]>
*/
@GET("store/order/{order_id}")
fun getOrderById(@Path("order_id") orderId: kotlin.Long): Observable<Order>
@ -54,7 +54,7 @@ interface StoreApi {
* - 400: Invalid Order
*
* @param order order placed for purchasing the pet
* @return [Call]<[Order]>
* @return [Call]<[Order]>
*/
@POST("store/order")
fun placeOrder(@Body order: Order): Observable<Order>

View File

@ -15,7 +15,7 @@ interface UserApi {
* - 0: successful operation
*
* @param user Created user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("user")
fun createUser(@Body user: User): Observable<Unit>
@ -27,10 +27,10 @@ interface UserApi {
* - 0: successful operation
*
* @param user List of user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("user/createWithArray")
fun createUsersWithArrayInput(@Body user: kotlin.Array<User>): Observable<Unit>
fun createUsersWithArrayInput(@Body user: kotlin.collections.List<User>): Observable<Unit>
/**
* Creates list of users with given input array
@ -39,10 +39,10 @@ interface UserApi {
* - 0: successful operation
*
* @param user List of user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("user/createWithList")
fun createUsersWithListInput(@Body user: kotlin.Array<User>): Observable<Unit>
fun createUsersWithListInput(@Body user: kotlin.collections.List<User>): Observable<Unit>
/**
* Delete user
@ -52,7 +52,7 @@ interface UserApi {
* - 404: User not found
*
* @param username The name that needs to be deleted
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("user/{username}")
fun deleteUser(@Path("username") username: kotlin.String): Observable<Unit>
@ -66,7 +66,7 @@ interface UserApi {
* - 404: User not found
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return [Call]<[User]>
* @return [Call]<[User]>
*/
@GET("user/{username}")
fun getUserByName(@Path("username") username: kotlin.String): Observable<User>
@ -80,7 +80,7 @@ interface UserApi {
*
* @param username The user name for login
* @param password The password for login in clear text
* @return [Call]<[kotlin.String]>
* @return [Call]<[kotlin.String]>
*/
@GET("user/login")
fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Observable<kotlin.String>
@ -91,7 +91,7 @@ interface UserApi {
* Responses:
* - 0: successful operation
*
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@GET("user/logout")
fun logoutUser(): Observable<Unit>
@ -105,7 +105,7 @@ interface UserApi {
*
* @param username name that need to be deleted
* @param user Updated user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("user/{username}")
fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Observable<Unit>

View File

@ -22,7 +22,8 @@ import retrofit2.converter.gson.GsonConverterFactory
class ApiClient(
private var baseUrl: String = defaultBasePath,
private val okHttpClientBuilder: OkHttpClient.Builder? = null,
private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder
private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
private val okHttpClient : OkHttpClient? = null
) {
private val apiAuthorizations = mutableMapOf<String, Interceptor>()
var logger: ((String) -> Unit)? = null
@ -74,7 +75,7 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
authName: String,
bearerToken: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setBearerToken(bearerToken)
@ -84,8 +85,8 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
username: String,
authName: String,
username: String,
password: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setCredentials(username, password)
@ -95,10 +96,10 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
clientId: String,
secret: String,
username: String,
authName: String,
clientId: String,
secret: String,
username: String,
password: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
getTokenEndPoint()
@ -226,7 +227,8 @@ class ApiClient(
}
fun <S> createService(serviceClass: Class<S>): S {
return retrofitBuilder.client(clientBuilder.build()).build().create(serviceClass)
val usedClient = this.okHttpClient ?: clientBuilder.build()
return retrofitBuilder.client(usedClient).build().create(serviceClass)
}
private fun normalizeBaseUrl() {
@ -244,10 +246,10 @@ class ApiClient(
}
}
companion object {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2")
}
}
}
}

View File

@ -11,7 +11,6 @@ import java.util.Date
object Serializer {
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())

View File

@ -26,6 +26,7 @@ import java.io.Serializable
* @param int64
* @param float
* @param double
* @param decimal
* @param string
* @param binary
* @param dateTime
@ -53,6 +54,8 @@ data class FormatTest (
val float: kotlin.Float? = null,
@SerializedName("double")
val double: kotlin.Double? = null,
@SerializedName("decimal")
val decimal: java.math.BigDecimal? = null,
@SerializedName("string")
val string: kotlin.String? = null,
@SerializedName("binary")

View File

@ -17,12 +17,12 @@ import java.io.Serializable
/**
*
* @param `123minusList`
* @param `123list`
*/
data class List (
@SerializedName("123-list")
val `123minusList`: kotlin.String? = null
val `123list`: kotlin.String? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 123

View File

@ -17,12 +17,12 @@ import java.io.Serializable
/**
*
* @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket
* @param dollarSpecialPropertyName
*/
data class SpecialModelname (
@SerializedName("\$special[property.name]")
val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null
val dollarSpecialPropertyName: kotlin.Long? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 123

View File

@ -27,12 +27,6 @@ docs/Foo.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
@ -100,12 +94,6 @@ src/main/kotlin/org/openapitools/client/models/Foo.kt
src/main/kotlin/org/openapitools/client/models/FormatTest.kt
src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt
src/main/kotlin/org/openapitools/client/models/InlineObject.kt
src/main/kotlin/org/openapitools/client/models/InlineObject1.kt
src/main/kotlin/org/openapitools/client/models/InlineObject2.kt
src/main/kotlin/org/openapitools/client/models/InlineObject3.kt
src/main/kotlin/org/openapitools/client/models/InlineObject4.kt
src/main/kotlin/org/openapitools/client/models/InlineObject5.kt
src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
src/main/kotlin/org/openapitools/client/models/List.kt
src/main/kotlin/org/openapitools/client/models/MapTest.kt

View File

@ -1 +1 @@
5.0.0-SNAPSHOT
5.0.1-SNAPSHOT

View File

@ -101,12 +101,6 @@ Class | Method | HTTP request | Description
- [org.openapitools.client.models.FormatTest](docs/FormatTest.md)
- [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md)
- [org.openapitools.client.models.InlineObject](docs/InlineObject.md)
- [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md)
- [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md)
- [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md)
- [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md)
- [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md)
- [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md)
- [org.openapitools.client.models.List](docs/List.md)
- [org.openapitools.client.models.MapTest](docs/MapTest.md)

View File

@ -31,8 +31,9 @@ test {
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0"
compile "com.google.code.gson:gson:2.8.6"
compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.0"
compile "com.squareup.okhttp3:logging-interceptor:4.4.0"
compile "io.reactivex.rxjava2:rxjava:$rxJava2Version"
compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"

View File

@ -440,13 +440,13 @@ To test enum parameters
val apiClient = ApiClient()
val webService = apiClient.createWebservice(FakeApi::class.java)
val enumHeaderStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Header parameter enum test (string array)
val enumHeaderStringArray : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Header parameter enum test (string array)
val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string)
val enumQueryStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Query parameter enum test (string array)
val enumQueryStringArray : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Query parameter enum test (string array)
val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string)
val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double)
val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double)
val enumFormStringArray : kotlin.Array<kotlin.String> = enumFormStringArray_example // kotlin.Array<kotlin.String> | Form parameter enum test (string array)
val enumFormStringArray : kotlin.collections.List<kotlin.String> = enumFormStringArray_example // kotlin.collections.List<kotlin.String> | Form parameter enum test (string array)
val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string)
webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
@ -456,14 +456,14 @@ webService.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQuery
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumHeaderStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2]
**enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
**enumFormStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to &quot;$&quot;] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumFormStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
### Return type
@ -617,11 +617,11 @@ To test the collection format in query parameters
val apiClient = ApiClient()
val webService = apiClient.createWebservice(FakeApi::class.java)
val pipe : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val ioutil : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val http : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val url : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val context : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val pipe : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val ioutil : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val http : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val url : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
val context : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> |
webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
```
@ -630,11 +630,11 @@ webService.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**pipe** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| |
### Return type

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**int64** | **kotlin.Long** | | [optional]
**float** | **kotlin.Float** | | [optional]
**double** | **kotlin.Double** | | [optional]
**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**string** | **kotlin.String** | | [optional]
**binary** | [**java.io.File**](java.io.File.md) | | [optional]
**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**&#x60;123minusList&#x60;** | **kotlin.String** | | [optional]
**&#x60;123list&#x60;** | **kotlin.String** | | [optional]

View File

@ -103,20 +103,20 @@ Multiple status values can be provided with comma separated strings
val apiClient = ApiClient()
val webService = apiClient.createWebservice(PetApi::class.java)
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
val result : kotlin.Array<Pet> = webService.findPetsByStatus(status)
val result : kotlin.collections.List<Pet> = webService.findPetsByStatus(status)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
**status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
@ -141,20 +141,20 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
val apiClient = ApiClient()
val webService = apiClient.createWebservice(PetApi::class.java)
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by
val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
val result : kotlin.Array<Pet> = webService.findPetsByTags(tags)
val result : kotlin.collections.List<Pet> = webService.findPetsByTags(tags)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
**tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional]
**dollarSpecialPropertyName** | **kotlin.Long** | | [optional]

View File

@ -64,7 +64,7 @@ Creates list of users with given input array
val apiClient = ApiClient()
val webService = apiClient.createWebservice(UserApi::class.java)
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
webService.createUsersWithArrayInput(user)
```
@ -73,7 +73,7 @@ webService.createUsersWithArrayInput(user)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type
@ -100,7 +100,7 @@ Creates list of users with given input array
val apiClient = ApiClient()
val webService = apiClient.createWebservice(UserApi::class.java)
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
webService.createUsersWithListInput(user)
```
@ -109,7 +109,7 @@ webService.createUsersWithListInput(user)
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type

View File

@ -16,7 +16,7 @@ interface AnotherFakeApi {
* - 200: successful operation
*
* @param client client model
* @return [Call]<[Client]>
* @return [Call]<[Client]>
*/
@PATCH("another-fake/dummy")
fun call123testSpecialTags(@Body client: Client): Single<Client>

View File

@ -15,7 +15,7 @@ interface DefaultApi {
* Responses:
* - 0: response
*
* @return [Call]<[InlineResponseDefault]>
* @return [Call]<[InlineResponseDefault]>
*/
@GET("foo")
fun fooGet(): Single<InlineResponseDefault>

View File

@ -13,6 +13,8 @@ import org.openapitools.client.models.OuterComposite
import org.openapitools.client.models.Pet
import org.openapitools.client.models.User
import okhttp3.MultipartBody
interface FakeApi {
/**
* Health check endpoint
@ -20,7 +22,7 @@ interface FakeApi {
* Responses:
* - 200: The instance started successfully
*
* @return [Call]<[HealthCheckResult]>
* @return [Call]<[HealthCheckResult]>
*/
@GET("fake/health")
fun fakeHealthGet(): Single<HealthCheckResult>
@ -34,10 +36,10 @@ interface FakeApi {
* @param pet Pet object that needs to be added to the store
* @param query1 query parameter (optional)
* @param header1 header parameter (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@GET("fake/http-signature-test")
fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Completable
fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String? = null, @Header("header_1") header1: kotlin.String): Completable
/**
*
@ -46,7 +48,7 @@ interface FakeApi {
* - 200: Output boolean
*
* @param body Input boolean as post body (optional)
* @return [Call]<[kotlin.Boolean]>
* @return [Call]<[kotlin.Boolean]>
*/
@POST("fake/outer/boolean")
fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean? = null): Single<kotlin.Boolean>
@ -58,7 +60,7 @@ interface FakeApi {
* - 200: Output composite
*
* @param outerComposite Input composite as post body (optional)
* @return [Call]<[OuterComposite]>
* @return [Call]<[OuterComposite]>
*/
@POST("fake/outer/composite")
fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite? = null): Single<OuterComposite>
@ -70,7 +72,7 @@ interface FakeApi {
* - 200: Output number
*
* @param body Input number as post body (optional)
* @return [Call]<[java.math.BigDecimal]>
* @return [Call]<[java.math.BigDecimal]>
*/
@POST("fake/outer/number")
fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal? = null): Single<java.math.BigDecimal>
@ -82,7 +84,7 @@ interface FakeApi {
* - 200: Output string
*
* @param body Input string as post body (optional)
* @return [Call]<[kotlin.String]>
* @return [Call]<[kotlin.String]>
*/
@POST("fake/outer/string")
fun fakeOuterStringSerialize(@Body body: kotlin.String? = null): Single<kotlin.String>
@ -94,7 +96,7 @@ interface FakeApi {
* - 200: Success
*
* @param fileSchemaTestClass
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("fake/body-with-file-schema")
fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Completable
@ -107,7 +109,7 @@ interface FakeApi {
*
* @param query
* @param user
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("fake/body-with-query-params")
fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Completable
@ -119,7 +121,7 @@ interface FakeApi {
* - 200: successful operation
*
* @param client client model
* @return [Call]<[Client]>
* @return [Call]<[Client]>
*/
@PATCH("fake")
fun testClientModel(@Body client: Client): Single<Client>
@ -145,7 +147,7 @@ interface FakeApi {
* @param dateTime None (optional)
* @param password None (optional)
* @param paramCallback None (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@POST("fake")
@ -159,18 +161,18 @@ interface FakeApi {
* - 404: Not found
*
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg")
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to "-efg")
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$")
* @param enumFormString Form parameter enum test (string) (optional, default to "-efg")
* @return [Call]<[Unit]>
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@GET("fake")
fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array<kotlin.String>, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Completable
fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.collections.List<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.collections.List<kotlin.String>? = null, @Query("enum_query_string") enumQueryString: kotlin.String? = null, @Query("enum_query_integer") enumQueryInteger: kotlin.Int? = null, @Query("enum_query_double") enumQueryDouble: kotlin.Double? = null, @Field("enum_form_string_array") enumFormStringArray: kotlin.collections.List<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Completable
/**
* Fake endpoint to test group parameters (optional)
@ -184,10 +186,10 @@ interface FakeApi {
* @param stringGroup String in group parameters (optional)
* @param booleanGroup Boolean in group parameters (optional)
* @param int64Group Integer in group parameters (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("fake")
fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Completable
fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int? = null, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long? = null): Completable
/**
* test inline additionalProperties
@ -196,7 +198,7 @@ interface FakeApi {
* - 200: successful operation
*
* @param requestBody request body
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("fake/inline-additionalProperties")
fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map<kotlin.String, kotlin.String>): Completable
@ -209,7 +211,7 @@ interface FakeApi {
*
* @param param field1
* @param param2 field2
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@GET("fake/jsonFormData")
@ -226,9 +228,9 @@ interface FakeApi {
* @param http
* @param url
* @param context
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("fake/test-query-paramters")
fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array<kotlin.String>): Completable
fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.collections.List<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SSVParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.collections.List<kotlin.String>): Completable
}

View File

@ -16,7 +16,7 @@ interface FakeClassnameTags123Api {
* - 200: successful operation
*
* @param client client model
* @return [Call]<[Client]>
* @return [Call]<[Client]>
*/
@PATCH("fake_classname_test")
fun testClassname(@Body client: Client): Single<Client>

View File

@ -9,15 +9,18 @@ import io.reactivex.Completable
import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
import okhttp3.MultipartBody
interface PetApi {
/**
* Add a new pet to the store
*
* Responses:
* - 200: Successful operation
* - 405: Invalid input
*
* @param pet Pet object that needs to be added to the store
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("pet")
fun addPet(@Body pet: Pet): Completable
@ -26,11 +29,12 @@ interface PetApi {
* Deletes a pet
*
* Responses:
* - 200: Successful operation
* - 400: Invalid pet value
*
* @param petId Pet id to delete
* @param apiKey (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("pet/{petId}")
fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable
@ -43,10 +47,10 @@ interface PetApi {
* - 400: Invalid status value
*
* @param status Status values that need to be considered for filter
* @return [Call]<[kotlin.Array<Pet>]>
* @return [Call]<[kotlin.collections.List<Pet>]>
*/
@GET("pet/findByStatus")
fun findPetsByStatus(@Query("status") status: CSVParams): Single<kotlin.Array<Pet>>
fun findPetsByStatus(@Query("status") status: CSVParams): Single<kotlin.collections.List<Pet>>
/**
* Finds Pets by tags
@ -56,11 +60,11 @@ interface PetApi {
* - 400: Invalid tag value
*
* @param tags Tags to filter by
* @return [Call]<[kotlin.Array<Pet>]>
* @return [Call]<[kotlin.collections.List<Pet>]>
*/
@Deprecated("This api was deprecated")
@GET("pet/findByTags")
fun findPetsByTags(@Query("tags") tags: CSVParams): Single<kotlin.Array<Pet>>
fun findPetsByTags(@Query("tags") tags: CSVParams): Single<kotlin.collections.List<Pet>>
/**
* Find pet by ID
@ -71,7 +75,7 @@ interface PetApi {
* - 404: Pet not found
*
* @param petId ID of pet to return
* @return [Call]<[Pet]>
* @return [Call]<[Pet]>
*/
@GET("pet/{petId}")
fun getPetById(@Path("petId") petId: kotlin.Long): Single<Pet>
@ -80,12 +84,13 @@ interface PetApi {
* Update an existing pet
*
* Responses:
* - 200: Successful operation
* - 400: Invalid ID supplied
* - 404: Pet not found
* - 405: Validation exception
*
* @param pet Pet object that needs to be added to the store
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("pet")
fun updatePet(@Body pet: Pet): Completable
@ -94,12 +99,13 @@ interface PetApi {
* Updates a pet in the store with form data
*
* Responses:
* - 200: Successful operation
* - 405: Invalid input
*
* @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional)
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@FormUrlEncoded
@POST("pet/{petId}")
@ -114,7 +120,7 @@ interface PetApi {
* @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional)
* @return [Call]<[ApiResponse]>
* @return [Call]<[ApiResponse]>
*/
@Multipart
@POST("pet/{petId}/uploadImage")
@ -129,7 +135,7 @@ interface PetApi {
* @param petId ID of pet to update
* @param requiredFile file to upload
* @param additionalMetadata Additional data to pass to server (optional)
* @return [Call]<[ApiResponse]>
* @return [Call]<[ApiResponse]>
*/
@Multipart
@POST("fake/{petId}/uploadImageWithRequiredFile")

View File

@ -17,7 +17,7 @@ interface StoreApi {
* - 404: Order not found
*
* @param orderId ID of the order that needs to be deleted
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("store/order/{order_id}")
fun deleteOrder(@Path("order_id") orderId: kotlin.String): Completable
@ -28,7 +28,7 @@ interface StoreApi {
* Responses:
* - 200: successful operation
*
* @return [Call]<[kotlin.collections.Map<kotlin.String, kotlin.Int>]>
* @return [Call]<[kotlin.collections.Map<kotlin.String, kotlin.Int>]>
*/
@GET("store/inventory")
fun getInventory(): Single<kotlin.collections.Map<kotlin.String, kotlin.Int>>
@ -42,7 +42,7 @@ interface StoreApi {
* - 404: Order not found
*
* @param orderId ID of pet that needs to be fetched
* @return [Call]<[Order]>
* @return [Call]<[Order]>
*/
@GET("store/order/{order_id}")
fun getOrderById(@Path("order_id") orderId: kotlin.Long): Single<Order>
@ -55,7 +55,7 @@ interface StoreApi {
* - 400: Invalid Order
*
* @param order order placed for purchasing the pet
* @return [Call]<[Order]>
* @return [Call]<[Order]>
*/
@POST("store/order")
fun placeOrder(@Body order: Order): Single<Order>

View File

@ -16,7 +16,7 @@ interface UserApi {
* - 0: successful operation
*
* @param user Created user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("user")
fun createUser(@Body user: User): Completable
@ -28,10 +28,10 @@ interface UserApi {
* - 0: successful operation
*
* @param user List of user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("user/createWithArray")
fun createUsersWithArrayInput(@Body user: kotlin.Array<User>): Completable
fun createUsersWithArrayInput(@Body user: kotlin.collections.List<User>): Completable
/**
* Creates list of users with given input array
@ -40,10 +40,10 @@ interface UserApi {
* - 0: successful operation
*
* @param user List of user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@POST("user/createWithList")
fun createUsersWithListInput(@Body user: kotlin.Array<User>): Completable
fun createUsersWithListInput(@Body user: kotlin.collections.List<User>): Completable
/**
* Delete user
@ -53,7 +53,7 @@ interface UserApi {
* - 404: User not found
*
* @param username The name that needs to be deleted
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@DELETE("user/{username}")
fun deleteUser(@Path("username") username: kotlin.String): Completable
@ -67,7 +67,7 @@ interface UserApi {
* - 404: User not found
*
* @param username The name that needs to be fetched. Use user1 for testing.
* @return [Call]<[User]>
* @return [Call]<[User]>
*/
@GET("user/{username}")
fun getUserByName(@Path("username") username: kotlin.String): Single<User>
@ -81,7 +81,7 @@ interface UserApi {
*
* @param username The user name for login
* @param password The password for login in clear text
* @return [Call]<[kotlin.String]>
* @return [Call]<[kotlin.String]>
*/
@GET("user/login")
fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single<kotlin.String>
@ -92,7 +92,7 @@ interface UserApi {
* Responses:
* - 0: successful operation
*
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@GET("user/logout")
fun logoutUser(): Completable
@ -106,7 +106,7 @@ interface UserApi {
*
* @param username name that need to be deleted
* @param user Updated user object
* @return [Call]<[Unit]>
* @return [Call]<[Unit]>
*/
@PUT("user/{username}")
fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Completable

View File

@ -22,7 +22,8 @@ import retrofit2.converter.gson.GsonConverterFactory
class ApiClient(
private var baseUrl: String = defaultBasePath,
private val okHttpClientBuilder: OkHttpClient.Builder? = null,
private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder
private val serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
private val okHttpClient : OkHttpClient? = null
) {
private val apiAuthorizations = mutableMapOf<String, Interceptor>()
var logger: ((String) -> Unit)? = null
@ -33,7 +34,7 @@ class ApiClient(
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(serializerBuilder.create()))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
}
}
private val clientBuilder: OkHttpClient.Builder by lazy {
okHttpClientBuilder ?: defaultClientBuilder
@ -74,7 +75,7 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
authName: String,
bearerToken: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setBearerToken(bearerToken)
@ -84,8 +85,8 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
username: String,
authName: String,
username: String,
password: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
setCredentials(username, password)
@ -95,10 +96,10 @@ class ApiClient(
baseUrl: String = defaultBasePath,
okHttpClientBuilder: OkHttpClient.Builder? = null,
serializerBuilder: GsonBuilder = Serializer.gsonBuilder,
authName: String,
clientId: String,
secret: String,
username: String,
authName: String,
clientId: String,
secret: String,
username: String,
password: String
) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) {
getTokenEndPoint()
@ -226,7 +227,8 @@ class ApiClient(
}
fun <S> createService(serviceClass: Class<S>): S {
return retrofitBuilder.client(clientBuilder.build()).build().create(serviceClass)
val usedClient = this.okHttpClient ?: clientBuilder.build()
return retrofitBuilder.client(usedClient).build().create(serviceClass)
}
private fun normalizeBaseUrl() {
@ -244,10 +246,10 @@ class ApiClient(
}
}
companion object {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2")
}
}
}
}

View File

@ -11,7 +11,6 @@ import java.util.Date
object Serializer {
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())

View File

@ -26,6 +26,7 @@ import java.io.Serializable
* @param int64
* @param float
* @param double
* @param decimal
* @param string
* @param binary
* @param dateTime
@ -53,6 +54,8 @@ data class FormatTest (
val float: kotlin.Float? = null,
@SerializedName("double")
val double: kotlin.Double? = null,
@SerializedName("decimal")
val decimal: java.math.BigDecimal? = null,
@SerializedName("string")
val string: kotlin.String? = null,
@SerializedName("binary")

View File

@ -17,12 +17,12 @@ import java.io.Serializable
/**
*
* @param `123minusList`
* @param `123list`
*/
data class List (
@SerializedName("123-list")
val `123minusList`: kotlin.String? = null
val `123list`: kotlin.String? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 123

View File

@ -17,12 +17,12 @@ import java.io.Serializable
/**
*
* @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket
* @param dollarSpecialPropertyName
*/
data class SpecialModelname (
@SerializedName("\$special[property.name]")
val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null
val dollarSpecialPropertyName: kotlin.Long? = null
) : Serializable {
companion object {
private const val serialVersionUID: Long = 123

View File

@ -27,12 +27,6 @@ docs/Foo.md
docs/FormatTest.md
docs/HasOnlyReadOnly.md
docs/HealthCheckResult.md
docs/InlineObject.md
docs/InlineObject1.md
docs/InlineObject2.md
docs/InlineObject3.md
docs/InlineObject4.md
docs/InlineObject5.md
docs/InlineResponseDefault.md
docs/List.md
docs/MapTest.md
@ -102,12 +96,6 @@ src/commonMain/kotlin/org/openapitools/client/models/Foo.kt
src/commonMain/kotlin/org/openapitools/client/models/FormatTest.kt
src/commonMain/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
src/commonMain/kotlin/org/openapitools/client/models/HealthCheckResult.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineObject.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineObject1.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineObject2.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineObject3.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineObject4.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineObject5.kt
src/commonMain/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
src/commonMain/kotlin/org/openapitools/client/models/List.kt
src/commonMain/kotlin/org/openapitools/client/models/MapTest.kt

View File

@ -1 +1 @@
5.0.0-SNAPSHOT
5.0.1-SNAPSHOT

View File

@ -92,12 +92,6 @@ Class | Method | HTTP request | Description
- [org.openapitools.client.models.FormatTest](docs/FormatTest.md)
- [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md)
- [org.openapitools.client.models.InlineObject](docs/InlineObject.md)
- [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md)
- [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md)
- [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md)
- [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md)
- [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md)
- [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md)
- [org.openapitools.client.models.List](docs/List.md)
- [org.openapitools.client.models.MapTest](docs/MapTest.md)

View File

@ -551,13 +551,13 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2]
**enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
**enumFormStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to &quot;$&quot;] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to &quot;-efg&quot;] [enum: _abc, -efg, (xyz)]
**enumFormStringArray** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
### Return type

View File

@ -13,6 +13,7 @@ Name | Type | Description | Notes
**int64** | **kotlin.Long** | | [optional]
**float** | **kotlin.Float** | | [optional]
**double** | **kotlin.Double** | | [optional]
**decimal** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**string** | **kotlin.String** | | [optional]
**binary** | [**org.openapitools.client.infrastructure.OctetByteArray**](org.openapitools.client.infrastructure.OctetByteArray.md) | | [optional]
**dateTime** | **kotlin.String** | | [optional]

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**&#x60;123minusList&#x60;** | **kotlin.String** | | [optional]
**&#x60;123list&#x60;** | **kotlin.String** | | [optional]

View File

@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional]
**dollarSpecialPropertyName** | **kotlin.Long** | | [optional]

View File

@ -405,13 +405,13 @@ class FakeApi @UseExperimental(UnstableDefault::class) constructor(
* To test enum parameters
* To test enum parameters
* @param enumHeaderStringArray Header parameter enum test (string array) (optional)
* @param enumHeaderString Header parameter enum test (string) (optional, default to "-efg")
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
* @param enumQueryStringArray Query parameter enum test (string array) (optional)
* @param enumQueryString Query parameter enum test (string) (optional, default to "-efg")
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
* @param enumQueryInteger Query parameter enum test (double) (optional)
* @param enumQueryDouble Query parameter enum test (double) (optional)
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to "$")
* @param enumFormString Form parameter enum test (string) (optional, default to "-efg")
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
* @return void
*/
suspend fun testEnumParameters(enumHeaderStringArray: kotlin.collections.List<kotlin.String>?, enumHeaderString: kotlin.String?, enumQueryStringArray: kotlin.collections.List<kotlin.String>?, enumQueryString: kotlin.String?, enumQueryInteger: kotlin.Int?, enumQueryDouble: kotlin.Double?, enumFormStringArray: kotlin.collections.List<kotlin.String>?, enumFormString: kotlin.String?): HttpResponse<Unit> {

View File

@ -46,7 +46,6 @@ open class ApiClient(
val clientConfig: (HttpClientConfig<*>) -> Unit = { it.install(JsonFeature, jsonConfig) }
httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig)
}
private val authentications: kotlin.collections.Map<String, Authentication> by lazy {
mapOf(
"api_key" to ApiKeyAuth("header", "api_key"),
@ -98,12 +97,6 @@ open class ApiClient(
serializer.setMapper(org.openapitools.client.models.FormatTest::class, org.openapitools.client.models.FormatTest.serializer())
serializer.setMapper(org.openapitools.client.models.HasOnlyReadOnly::class, org.openapitools.client.models.HasOnlyReadOnly.serializer())
serializer.setMapper(org.openapitools.client.models.HealthCheckResult::class, org.openapitools.client.models.HealthCheckResult.serializer())
serializer.setMapper(org.openapitools.client.models.InlineObject::class, org.openapitools.client.models.InlineObject.serializer())
serializer.setMapper(org.openapitools.client.models.InlineObject1::class, org.openapitools.client.models.InlineObject1.serializer())
serializer.setMapper(org.openapitools.client.models.InlineObject2::class, org.openapitools.client.models.InlineObject2.serializer())
serializer.setMapper(org.openapitools.client.models.InlineObject3::class, org.openapitools.client.models.InlineObject3.serializer())
serializer.setMapper(org.openapitools.client.models.InlineObject4::class, org.openapitools.client.models.InlineObject4.serializer())
serializer.setMapper(org.openapitools.client.models.InlineObject5::class, org.openapitools.client.models.InlineObject5.serializer())
serializer.setMapper(org.openapitools.client.models.InlineResponseDefault::class, org.openapitools.client.models.InlineResponseDefault.serializer())
serializer.setMapper(org.openapitools.client.models.List::class, org.openapitools.client.models.List.serializer())
serializer.setMapper(org.openapitools.client.models.MapTest::class, org.openapitools.client.models.MapTest.serializer())
@ -133,7 +126,7 @@ open class ApiClient(
* @param username Username
*/
fun setUsername(username: String) {
val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth?
val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth?
?: throw Exception("No HTTP basic authentication configured")
auth.username = username
}
@ -144,7 +137,7 @@ open class ApiClient(
* @param password Password
*/
fun setPassword(password: String) {
val auth = authentications.values.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth?
val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth?
?: throw Exception("No HTTP basic authentication configured")
auth.password = password
}
@ -156,7 +149,7 @@ open class ApiClient(
* @param paramName The name of the API key parameter, or null or set the first key.
*/
fun setApiKey(apiKey: String, paramName: String? = null) {
val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth?
val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth?
?: throw Exception("No API key authentication configured")
auth.apiKey = apiKey
}
@ -168,7 +161,7 @@ open class ApiClient(
* @param paramName The name of the API key parameter, or null or set the first key.
*/
fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) {
val auth = authentications.values.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth?
val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth?
?: throw Exception("No API key authentication configured")
auth.apiKeyPrefix = apiKeyPrefix
}
@ -179,7 +172,7 @@ open class ApiClient(
* @param accessToken Access token
*/
fun setAccessToken(accessToken: String) {
val auth = authentications.values.firstOrNull { it is OAuth } as OAuth?
val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth?
?: throw Exception("No OAuth2 authentication configured")
auth.accessToken = accessToken
}
@ -190,7 +183,7 @@ open class ApiClient(
* @param bearerToken The bearer token.
*/
fun setBearerToken(bearerToken: String) {
val auth = authentications.values.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth?
val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth?
?: throw Exception("No Bearer authentication configured")
auth.bearerToken = bearerToken
}
@ -234,7 +227,7 @@ open class ApiClient(
private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List<String>) {
for (authName in authNames) {
val auth = authentications[authName] ?: throw Exception("Authentication undefined: $authName")
val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName")
auth.apply(query, headers)
}
}

View File

@ -26,6 +26,7 @@ import kotlinx.serialization.internal.CommonEnumSerializer
* @param int64
* @param float
* @param double
* @param decimal
* @param string
* @param binary
* @param dateTime
@ -44,6 +45,7 @@ data class FormatTest (
@SerialName(value = "int64") val int64: kotlin.Long? = null,
@SerialName(value = "float") val float: kotlin.Float? = null,
@SerialName(value = "double") val double: kotlin.Double? = null,
@SerialName(value = "decimal") val decimal: java.math.BigDecimal? = null,
@SerialName(value = "string") val string: kotlin.String? = null,
@SerialName(value = "binary") val binary: org.openapitools.client.infrastructure.OctetByteArray? = null,
@SerialName(value = "dateTime") val dateTime: kotlin.String? = null,

View File

@ -17,10 +17,10 @@ import kotlinx.serialization.internal.CommonEnumSerializer
/**
*
* @param `123minusList`
* @param `123list`
*/
@Serializable
data class List (
@SerialName(value = "123-list") val `123minusList`: kotlin.String? = null
@SerialName(value = "123-list") val `123list`: kotlin.String? = null
)

Some files were not shown because too many files have changed in this diff Show More