mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 10:26:11 +00:00
[kotlin-client][kotlin-server] feature: allow creation of kotlin data classes that implement java.io.Serializable (#3997)
* feat: allow creation of kotlin data classes that implement java.io.Serializable, by adding the config option serializableModel=(true|false) * docs: add markdown docu for new configOption serializableModel * fix: do not use parcelize in script * update kotlin samples * add the option, update the doc
This commit is contained in:
@@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
* @param code
|
||||
@@ -27,5 +28,7 @@ data class ApiResponse (
|
||||
val type: kotlin.String? = null,
|
||||
@Json(name = "message")
|
||||
val message: kotlin.String? = null
|
||||
)
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A category for a pet
|
||||
* @param id
|
||||
@@ -24,5 +25,7 @@ data class Category (
|
||||
val id: kotlin.Long? = null,
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
* @param id
|
||||
@@ -37,7 +38,9 @@ data class Order (
|
||||
val status: Order.Status? = null,
|
||||
@Json(name = "complete")
|
||||
val complete: kotlin.Boolean? = null
|
||||
)
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
|
||||
import org.openapitools.client.models.Tag
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
* @param id
|
||||
@@ -39,7 +40,9 @@ data class Pet (
|
||||
/* pet status in the store */
|
||||
@Json(name = "status")
|
||||
val status: Pet.Status? = null
|
||||
)
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A tag for a pet
|
||||
* @param id
|
||||
@@ -24,5 +25,7 @@ data class Tag (
|
||||
val id: kotlin.Long? = null,
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
* @param id
|
||||
@@ -43,5 +44,7 @@ data class User (
|
||||
/* User Status */
|
||||
@Json(name = "userStatus")
|
||||
val userStatus: kotlin.Int? = null
|
||||
)
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user