Skip to content

Commit 484b87f

Browse files
authored
fix: Template contains unconditional ": Serializable" which creates wrong derive clause on data classes which have a parent as well as are serializable. (OpenAPITools#19283)
1 parent 7f551bb commit 484b87f

92 files changed

Lines changed: 92 additions & 92 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}},
1818
{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>dataClassOptVar}}{{^-last}},
1919
{{/-last}}{{/optionalVars}}
20-
) {{/discriminator}}{{#parent}}: {{{.}}}{{#serializableModel}}, Serializable{{/serializableModel}}{{/parent}}{{#serializableModel}}: Serializable{{/serializableModel}}{
20+
) {{/discriminator}}{{#parent}}: {{{.}}}{{#serializableModel}}, Serializable{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}: Serializable{{/serializableModel}}{{/parent}}{
2121
{{#discriminator}}
2222
{{#requiredVars}}
2323
{{>interfaceReqVar}}

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data class Category(
2424

2525
@get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
2626
@get:JsonProperty("name") val name: kotlin.String? = null
27-
) : Serializable{
27+
) : Serializable{
2828

2929
companion object {
3030
private const val serialVersionUID: kotlin.Long = 1

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ data class ModelApiResponse(
2626
@get:JsonProperty("type") val type: kotlin.String? = null,
2727

2828
@get:JsonProperty("message") val message: kotlin.String? = null
29-
) : Serializable{
29+
) : Serializable{
3030

3131
companion object {
3232
private const val serialVersionUID: kotlin.Long = 1

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ data class Order(
3737
@get:JsonProperty("status") val status: Order.Status? = null,
3838

3939
@get:JsonProperty("complete") val complete: kotlin.Boolean? = false
40-
) : Serializable{
40+
) : Serializable{
4141

4242
/**
4343
* Order Status

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ data class Pet(
4242

4343
@Deprecated(message = "")
4444
@get:JsonProperty("status") val status: Pet.Status? = null
45-
) : Serializable{
45+
) : Serializable{
4646

4747
/**
4848
* pet status in the store

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data class Tag(
2323
@get:JsonProperty("id") val id: kotlin.Long? = null,
2424

2525
@get:JsonProperty("name") val name: kotlin.String? = null
26-
) : Serializable{
26+
) : Serializable{
2727

2828
companion object {
2929
private const val serialVersionUID: kotlin.Long = 1

samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ data class User(
4141
@get:JsonProperty("phone") val phone: kotlin.String? = null,
4242

4343
@get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null
44-
) : Serializable{
44+
) : Serializable{
4545

4646
companion object {
4747
private const val serialVersionUID: kotlin.Long = 1

samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Annotation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data class Annotation(
2121

2222
@Schema(example = "null", description = "")
2323
@get:JsonProperty("id") val id: java.util.UUID? = null
24-
) {
24+
) {
2525

2626
}
2727

samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ data class AnyOfUserOrPet(
7878
@Schema(example = "null", description = "pet status in the store")
7979
@Deprecated(message = "")
8080
@get:JsonProperty("status") val status: AnyOfUserOrPet.Status? = null
81-
) {
81+
) {
8282

8383
/**
8484
* pet status in the store

samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ data class AnyOfUserOrPetOrArrayString(
7878
@Schema(example = "null", description = "pet status in the store")
7979
@Deprecated(message = "")
8080
@get:JsonProperty("status") val status: AnyOfUserOrPetOrArrayString.Status? = null
81-
) {
81+
) {
8282

8383
/**
8484
* pet status in the store

0 commit comments

Comments
 (0)