[kotlin][client] Add Jackson as serialization library (#5236)

* [kotlin][client] Add Jackson as serialization library

* [kotlin][client] Add kotlin-client-jackson.sh to kotlin-client-all.sh

* update kotlin client samples

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Herve DARRITCHON
2020-02-25 16:41:09 +01:00
committed by GitHub
parent 8b64f4d03e
commit f6ef4fbec7
262 changed files with 3720 additions and 257 deletions

View File

@@ -22,8 +22,11 @@ import kotlinx.serialization.internal.CommonEnumSerializer
*/
@Serializable
data class ApiResponse (
@SerialName(value = "code") val code: kotlin.Int? = null,
@SerialName(value = "type") val type: kotlin.String? = null,
@SerialName(value = "code") val code: kotlin.Int? = null
,
@SerialName(value = "type") val type: kotlin.String? = null
,
@SerialName(value = "message") val message: kotlin.String? = null
)

View File

@@ -21,7 +21,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer
*/
@Serializable
data class Category (
@SerialName(value = "id") val id: kotlin.Long? = null,
@SerialName(value = "id") val id: kotlin.Long? = null
,
@SerialName(value = "name") val name: kotlin.String? = null
)

View File

@@ -25,13 +25,19 @@ import kotlinx.serialization.internal.CommonEnumSerializer
*/
@Serializable
data class Order (
@SerialName(value = "id") val id: kotlin.Long? = null,
@SerialName(value = "petId") val petId: kotlin.Long? = null,
@SerialName(value = "quantity") val quantity: kotlin.Int? = null,
@SerialName(value = "shipDate") val shipDate: kotlin.String? = null,
@SerialName(value = "id") val id: kotlin.Long? = null
,
@SerialName(value = "petId") val petId: kotlin.Long? = null
,
@SerialName(value = "quantity") val quantity: kotlin.Int? = null
,
@SerialName(value = "shipDate") val shipDate: kotlin.String? = null
,
/* Order Status */
@SerialName(value = "status") val status: Order.Status? = null,
@SerialName(value = "status") val status: Order.Status? = null
,
@SerialName(value = "complete") val complete: kotlin.Boolean? = null
) {
/**
@@ -39,6 +45,7 @@ data class Order (
* Values: placed,approved,delivered
*/
@Serializable(with = Status.Serializer::class)
enum class Status(val value: kotlin.String){
placed("placed"),
approved("approved"),

View File

@@ -27,13 +27,19 @@ import kotlinx.serialization.internal.CommonEnumSerializer
*/
@Serializable
data class Pet (
@SerialName(value = "name") @Required val name: kotlin.String,
@SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array<kotlin.String>,
@SerialName(value = "id") val id: kotlin.Long? = null,
@SerialName(value = "category") val category: Category? = null,
@SerialName(value = "tags") val tags: kotlin.Array<Tag>? = null,
@SerialName(value = "name") @Required val name: kotlin.String
,
@SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array<kotlin.String>
,
@SerialName(value = "id") val id: kotlin.Long? = null
,
@SerialName(value = "category") val category: Category? = null
,
@SerialName(value = "tags") val tags: kotlin.Array<Tag>? = null
,
/* pet status in the store */
@SerialName(value = "status") val status: Pet.Status? = null
) {
/**
@@ -41,6 +47,7 @@ data class Pet (
* Values: available,pending,sold
*/
@Serializable(with = Status.Serializer::class)
enum class Status(val value: kotlin.String){
available("available"),
pending("pending"),

View File

@@ -21,7 +21,9 @@ import kotlinx.serialization.internal.CommonEnumSerializer
*/
@Serializable
data class Tag (
@SerialName(value = "id") val id: kotlin.Long? = null,
@SerialName(value = "id") val id: kotlin.Long? = null
,
@SerialName(value = "name") val name: kotlin.String? = null
)

View File

@@ -27,14 +27,22 @@ import kotlinx.serialization.internal.CommonEnumSerializer
*/
@Serializable
data class User (
@SerialName(value = "id") val id: kotlin.Long? = null,
@SerialName(value = "username") val username: kotlin.String? = null,
@SerialName(value = "firstName") val firstName: kotlin.String? = null,
@SerialName(value = "lastName") val lastName: kotlin.String? = null,
@SerialName(value = "email") val email: kotlin.String? = null,
@SerialName(value = "password") val password: kotlin.String? = null,
@SerialName(value = "phone") val phone: kotlin.String? = null,
@SerialName(value = "id") val id: kotlin.Long? = null
,
@SerialName(value = "username") val username: kotlin.String? = null
,
@SerialName(value = "firstName") val firstName: kotlin.String? = null
,
@SerialName(value = "lastName") val lastName: kotlin.String? = null
,
@SerialName(value = "email") val email: kotlin.String? = null
,
@SerialName(value = "password") val password: kotlin.String? = null
,
@SerialName(value = "phone") val phone: kotlin.String? = null
,
/* User Status */
@SerialName(value = "userStatus") val userStatus: kotlin.Int? = null
)