forked from loafle/openapi-generator-original
[kotlin] fix Date types usages (#8594)
* [kotlin] fix Date types usages
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.0.0-SNAPSHOT
|
||||
5.0.1-SNAPSHOT
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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<kotlin.String>**](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.Array<kotlin.String>**](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)]
|
||||
**enumHeaderStringArray** | [**kotlin.collections.List<kotlin.String>**](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<kotlin.String>**](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<kotlin.String>**](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)]
|
||||
**enumFormStringArray** | [**kotlin.collections.List<kotlin.String>**](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<kotlin.String>**](kotlin.String.md)| |
|
||||
**ioutil** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| |
|
||||
**http** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| |
|
||||
**url** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| |
|
||||
**context** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| |
|
||||
**pipe** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| |
|
||||
**ioutil** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| |
|
||||
**http** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| |
|
||||
**url** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| |
|
||||
**context** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**`123minusList`** | **kotlin.String** | | [optional]
|
||||
**`123list`** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
|
||||
**status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
|
||||
|
||||
### Return type
|
||||
|
||||
[**kotlin.Array<Pet>**](Pet.md)
|
||||
[**kotlin.collections.List<Pet>**](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<kotlin.String>**](kotlin.String.md)| Tags to filter by |
|
||||
**tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by |
|
||||
|
||||
### Return type
|
||||
|
||||
[**kotlin.Array<Pet>**](Pet.md)
|
||||
[**kotlin.collections.List<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional]
|
||||
**dollarSpecialPropertyName** | **kotlin.Long** | | [optional]
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<User>**](User.md)| List of user object |
|
||||
**user** | [**kotlin.collections.List<User>**](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<User>**](User.md)| List of user object |
|
||||
**user** | [**kotlin.collections.List<User>**](User.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -15,7 +15,7 @@ interface DefaultApi {
|
||||
* Responses:
|
||||
* - 0: response
|
||||
*
|
||||
* @return [Call]<[InlineResponseDefault]>
|
||||
* @return [Call]<[InlineResponseDefault]>
|
||||
*/
|
||||
@GET("foo")
|
||||
fun fooGet(): Single<InlineResponseDefault>
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user