[kotlin-client][kotlin-server] Feature/kotlin data class serial version uid (#4021)

* feat: add companion object to data classes if the implement the interface java.io.Serializable

* style: format template file

* style: adapt to project's original code style

* fix: add missing imports

* style: reverted mustache template to original styling

* test: generate additional samples for kotlin-springboot-reactive and kotlin-springboot

* docs: name full qualified classname of interface java.io.Serializable to prevent confusion with kotlinx.serialization
This commit is contained in:
Jan
2019-10-09 09:17:53 +02:00
committed by William Cheng
parent cf38c56aa6
commit bbfcd3bf64
108 changed files with 840 additions and 505 deletions

View File

@@ -23,10 +23,10 @@ data class ApiResponse (
val code: kotlin.Int? = null,
val type: kotlin.String? = null,
val message: kotlin.String? = null
)
: Serializable
) : Serializable
{
companion object {
private const val serialVersionUID: Long = 123
}
}

View File

@@ -21,10 +21,10 @@ import java.io.Serializable
data class Category (
val id: kotlin.Long? = null,
val name: kotlin.String? = null
)
: Serializable
) : Serializable
{
companion object {
private const val serialVersionUID: Long = 123
}
}

View File

@@ -30,11 +30,12 @@ data class Order (
/* Order Status */
val status: Order.Status? = null,
val complete: kotlin.Boolean? = null
)
: Serializable
) : Serializable
{
companion object {
private const val serialVersionUID: Long = 123
}
/**
* Order Status
* Values: placed,approved,delivered
@@ -48,6 +49,5 @@ data class Order (
delivered("delivered");
}
}

View File

@@ -32,11 +32,12 @@ data class Pet (
val tags: kotlin.Array<Tag>? = null,
/* pet status in the store */
val status: Pet.Status? = null
)
: Serializable
) : Serializable
{
companion object {
private const val serialVersionUID: Long = 123
}
/**
* pet status in the store
* Values: available,pending,sold
@@ -50,6 +51,5 @@ data class Pet (
sold("sold");
}
}

View File

@@ -21,10 +21,10 @@ import java.io.Serializable
data class Tag (
val id: kotlin.Long? = null,
val name: kotlin.String? = null
)
: Serializable
) : Serializable
{
companion object {
private const val serialVersionUID: Long = 123
}
}

View File

@@ -34,10 +34,10 @@ data class User (
val phone: kotlin.String? = null,
/* User Status */
val userStatus: kotlin.Int? = null
)
: Serializable
) : Serializable
{
companion object {
private const val serialVersionUID: Long = 123
}
}