Skip to content

Commit 6fd86fe

Browse files
committed
fix dataclass
1 parent c38b6b9 commit 6fd86fe

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

samples/server/petstore/kotlin-server/ktor2/src/main/kotlin/org/openapitools/server/models/Category.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@
1212
package org.openapitools.server.models
1313

1414

15-
import kotlinx.serialization.Serializable
15+
import java.io.Serializable
1616
/**
1717
* A category for a pet
1818
* @param id
1919
* @param name
2020
*/
21-
@Serializable
2221
data class Category(
2322
val id: kotlin.Long? = null,
2423
val name: kotlin.String? = null
25-
)
24+
) : Serializable
2625
{
26+
companion object {
27+
private const val serialVersionUID: Long = 123
28+
}
2729
}
2830

samples/server/petstore/kotlin-server/ktor2/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@
1212
package org.openapitools.server.models
1313

1414

15-
import kotlinx.serialization.Serializable
15+
import java.io.Serializable
1616
/**
1717
* Describes the result of uploading an image resource
1818
* @param code
1919
* @param type
2020
* @param message
2121
*/
22-
@Serializable
2322
data class ModelApiResponse(
2423
val code: kotlin.Int? = null,
2524
val type: kotlin.String? = null,
2625
val message: kotlin.String? = null
27-
)
26+
) : Serializable
2827
{
28+
companion object {
29+
private const val serialVersionUID: Long = 123
30+
}
2931
}
3032

samples/server/petstore/kotlin-server/ktor2/src/main/kotlin/org/openapitools/server/models/Order.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package org.openapitools.server.models
1313

1414

15-
import kotlinx.serialization.Serializable
15+
import java.io.Serializable
1616
/**
1717
* An order for a pets from the pet store
1818
* @param id
@@ -22,7 +22,6 @@ import kotlinx.serialization.Serializable
2222
* @param status Order Status
2323
* @param complete
2424
*/
25-
@Serializable
2625
data class Order(
2726
val id: kotlin.Long? = null,
2827
val petId: kotlin.Long? = null,
@@ -31,8 +30,11 @@ data class Order(
3130
/* Order Status */
3231
val status: Order.Status? = null,
3332
val complete: kotlin.Boolean? = false
34-
)
33+
) : Serializable
3534
{
35+
companion object {
36+
private const val serialVersionUID: Long = 123
37+
}
3638
/**
3739
* Order Status
3840
* Values: placed,approved,delivered

samples/server/petstore/kotlin-server/ktor2/src/main/kotlin/org/openapitools/server/models/Pet.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ package org.openapitools.server.models
1414
import org.openapitools.server.models.Category
1515
import org.openapitools.server.models.Tag
1616

17-
import kotlinx.serialization.Serializable
17+
import java.io.Serializable
1818
/**
1919
* A pet for sale in the pet store
2020
* @param name
@@ -24,7 +24,6 @@ import kotlinx.serialization.Serializable
2424
* @param tags
2525
* @param status pet status in the store
2626
*/
27-
@Serializable
2827
data class Pet(
2928
val name: kotlin.String,
3029
val photoUrls: kotlin.collections.List<kotlin.String>,
@@ -33,8 +32,11 @@ data class Pet(
3332
val tags: kotlin.collections.List<Tag>? = null,
3433
/* pet status in the store */
3534
val status: Pet.Status? = null
36-
)
35+
) : Serializable
3736
{
37+
companion object {
38+
private const val serialVersionUID: Long = 123
39+
}
3840
/**
3941
* pet status in the store
4042
* Values: available,pending,sold

samples/server/petstore/kotlin-server/ktor2/src/main/kotlin/org/openapitools/server/models/Tag.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@
1212
package org.openapitools.server.models
1313

1414

15-
import kotlinx.serialization.Serializable
15+
import java.io.Serializable
1616
/**
1717
* A tag for a pet
1818
* @param id
1919
* @param name
2020
*/
21-
@Serializable
2221
data class Tag(
2322
val id: kotlin.Long? = null,
2423
val name: kotlin.String? = null
25-
)
24+
) : Serializable
2625
{
26+
companion object {
27+
private const val serialVersionUID: Long = 123
28+
}
2729
}
2830

samples/server/petstore/kotlin-server/ktor2/src/main/kotlin/org/openapitools/server/models/User.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package org.openapitools.server.models
1313

1414

15-
import kotlinx.serialization.Serializable
15+
import java.io.Serializable
1616
/**
1717
* A User who is purchasing from the pet store
1818
* @param id
@@ -24,7 +24,6 @@ import kotlinx.serialization.Serializable
2424
* @param phone
2525
* @param userStatus User Status
2626
*/
27-
@Serializable
2827
data class User(
2928
val id: kotlin.Long? = null,
3029
val username: kotlin.String? = null,
@@ -35,7 +34,10 @@ data class User(
3534
val phone: kotlin.String? = null,
3635
/* User Status */
3736
val userStatus: kotlin.Int? = null
38-
)
37+
) : Serializable
3938
{
39+
companion object {
40+
private const val serialVersionUID: Long = 123
41+
}
4042
}
4143

0 commit comments

Comments
 (0)