forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 6.0.x
This commit is contained in:
@@ -30,7 +30,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt
|
||||
@@ -40,8 +39,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt
|
||||
src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
|
||||
src/main/kotlin/org/openapitools/client/models/Category.kt
|
||||
src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt
|
||||
src/main/kotlin/org/openapitools/client/models/Order.kt
|
||||
src/main/kotlin/org/openapitools/client/models/Pet.kt
|
||||
src/main/kotlin/org/openapitools/client/models/Tag.kt
|
||||
|
||||
@@ -60,8 +60,8 @@ Class | Method | HTTP request | Description
|
||||
<a name="documentation-for-models"></a>
|
||||
## Documentation for Models
|
||||
|
||||
- [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md)
|
||||
- [org.openapitools.client.models.Category](docs/Category.md)
|
||||
- [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md)
|
||||
- [org.openapitools.client.models.Order](docs/Order.md)
|
||||
- [org.openapitools.client.models.Pet](docs/Pet.md)
|
||||
- [org.openapitools.client.models.Tag](docs/Tag.md)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
# ApiResponse
|
||||
# ModelApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
|
||||
@@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update
|
||||
val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server
|
||||
val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload
|
||||
|
||||
val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file)
|
||||
val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file)
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@@ -307,7 +307,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
[**ModelApiResponse**](ModelApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import retrofit2.http.*
|
||||
import retrofit2.Call
|
||||
import okhttp3.RequestBody
|
||||
|
||||
import org.openapitools.client.models.ApiResponse
|
||||
import org.openapitools.client.models.ModelApiResponse
|
||||
import org.openapitools.client.models.Pet
|
||||
|
||||
import okhttp3.MultipartBody
|
||||
@@ -115,10 +115,10 @@ 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]<[ModelApiResponse]>
|
||||
*/
|
||||
@Multipart
|
||||
@POST("pet/{petId}/uploadImage")
|
||||
fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call<ApiResponse>
|
||||
fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call<ModelApiResponse>
|
||||
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import kotlinx.serialization.KSerializer
|
||||
import kotlinx.serialization.Serializer
|
||||
import kotlinx.serialization.encoding.Decoder
|
||||
import kotlinx.serialization.encoding.Encoder
|
||||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor
|
||||
import kotlinx.serialization.descriptors.PrimitiveKind
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import java.text.DateFormat
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
@Serializer(forClass = Date::class)
|
||||
object DateAdapter : KSerializer<Date> {
|
||||
private val df: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())
|
||||
|
||||
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Date", PrimitiveKind.STRING)
|
||||
|
||||
override fun serialize(encoder: Encoder, value: Date) {
|
||||
encoder.encodeString(df.format(value))
|
||||
}
|
||||
|
||||
override fun deserialize(decoder: Decoder): Date {
|
||||
return df.parse(decoder.decodeString())!!
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import java.util.Date
|
||||
import java.math.BigDecimal
|
||||
import java.math.BigInteger
|
||||
import java.time.LocalDate
|
||||
@@ -20,7 +19,6 @@ object Serializer {
|
||||
val kotlinSerializationAdapters = SerializersModule {
|
||||
contextual(BigDecimal::class, BigDecimalAdapter)
|
||||
contextual(BigInteger::class, BigIntegerAdapter)
|
||||
contextual(Date::class, DateAdapter)
|
||||
contextual(LocalDate::class, LocalDateAdapter)
|
||||
contextual(LocalDateTime::class, LocalDateTimeAdapter)
|
||||
contextual(OffsetDateTime::class, OffsetDateTimeAdapter)
|
||||
|
||||
@@ -34,7 +34,7 @@ import java.io.Serializable
|
||||
* @param message
|
||||
*/
|
||||
@KSerializable
|
||||
data class ApiResponse (
|
||||
data class ModelApiResponse (
|
||||
|
||||
@SerialName(value = "code")
|
||||
val code: kotlin.Int? = null,
|
||||
Reference in New Issue
Block a user