Skip to content

Commit e837d3e

Browse files
committed
add updated files
1 parent 5d00c83 commit e837d3e

107 files changed

Lines changed: 1460 additions & 818 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/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -525,43 +525,39 @@ components:
525525
type: string
526526
nonRequiredWithDefaultList:
527527
type: array
528-
required: false
528+
items:
529+
type: string
529530
default: [ ]
530531
nonRequiredWithDefaultSet:
531532
type: array
533+
items:
534+
type: string
532535
uniqueItems: true
533-
required: false
534536
default: [ ]
535537
nonRequiredWithDefaultString:
536538
type: string
537-
required: false
538539
default: defaultValue
539540
nonRequiredWithDefaultInt:
540541
type: number
541542
format: int32
542-
required: false
543543
default: 15
544544
nonRequiredWithDefaultLong:
545545
type: number
546546
format: int64
547-
required: false
548547
default: 15
549548
nonRequiredWithDefaultFloat:
550549
type: number
551550
format: float
552-
required: false
553551
default: 15.45
554552
nonRequiredWithDefaultDouble:
555553
type: number
556554
format: double
557-
required: false
558555
default: 15.45
559556
nonRequiredWithDefaultEnum:
560557
type: string
561558
enum:
562559
- THIS
563560
- THAT
564-
required: false
565561
default: THIS
566562
nonRequiredWithDefaultEnumList:
567563
type: array
@@ -571,7 +567,6 @@ components:
571567
- THESE
572568
- THOSE
573569
- THEM
574-
required: false
575570
default: [ THESE, THOSE ]
576571
nonRequiredWithDefaultEnumSet:
577572
type: array
@@ -582,7 +577,6 @@ components:
582577
- THESE
583578
- THOSE
584579
- THEM
585-
required: false
586580
default: [ THEM, THOSE ]
587581
photoUrls:
588582
type: array

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ import javax.validation.Valid
2121
*/
2222
data class Category(
2323

24-
@get:JsonProperty("id") val id: kotlin.Long? = null,
24+
@get:JsonProperty("id", required = false)
25+
val id: kotlin.Long? = null,
2526

2627
@get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
27-
@get:JsonProperty("name") val name: kotlin.String? = null
28+
@get:JsonProperty("name", required = false)
29+
val name: kotlin.String? = null
2830
) : Serializable {
2931

3032
companion object {

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ import javax.validation.Valid
2222
*/
2323
data class ModelApiResponse(
2424

25-
@get:JsonProperty("code") val code: kotlin.Int? = null,
25+
@get:JsonProperty("code", required = false)
26+
val code: kotlin.Int? = null,
2627

27-
@get:JsonProperty("type") val type: kotlin.String? = null,
28+
@get:JsonProperty("type", required = false)
29+
val type: kotlin.String? = null,
2830

29-
@get:JsonProperty("message") val message: kotlin.String? = null
31+
@get:JsonProperty("message", required = false)
32+
val message: kotlin.String? = null
3033
) : Serializable {
3134

3235
companion object {

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,23 @@ import javax.validation.Valid
2727
*/
2828
data class Order(
2929

30-
@get:JsonProperty("id") val id: kotlin.Long? = null,
30+
@get:JsonProperty("id", required = false)
31+
val id: kotlin.Long? = null,
3132

32-
@get:JsonProperty("petId") val petId: kotlin.Long? = null,
33+
@get:JsonProperty("petId", required = false)
34+
val petId: kotlin.Long? = null,
3335

34-
@get:JsonProperty("quantity") val quantity: kotlin.Int? = null,
36+
@get:JsonProperty("quantity", required = false)
37+
val quantity: kotlin.Int? = null,
3538

36-
@get:JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null,
39+
@get:JsonProperty("shipDate", required = false)
40+
val shipDate: java.time.OffsetDateTime? = null,
3741

38-
@get:JsonProperty("status") val status: Order.Status? = null,
42+
@get:JsonProperty("status", required = false)
43+
val status: Order.Status? = null,
3944

40-
@get:JsonProperty("complete") val complete: kotlin.Boolean? = false
45+
@get:JsonProperty("complete", required = false)
46+
val complete: kotlin.Boolean = false
4147
) : Serializable {
4248

4349
/**

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,26 @@ import javax.validation.Valid
2929
*/
3030
data class Pet(
3131

32-
@get:JsonProperty("name", required = true) val name: kotlin.String,
32+
@get:JsonProperty("name", required = true)
33+
val name: kotlin.String,
3334

34-
@get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List<kotlin.String>,
35+
@get:JsonProperty("photoUrls", required = true)
36+
val photoUrls: kotlin.collections.List<kotlin.String>,
3537

36-
@get:JsonProperty("id") val id: kotlin.Long? = null,
38+
@get:JsonProperty("id", required = false)
39+
val id: kotlin.Long? = null,
3740

3841
@field:Valid
39-
@get:JsonProperty("category") val category: Category? = null,
42+
@get:JsonProperty("category", required = false)
43+
val category: Category? = null,
4044

4145
@field:Valid
42-
@get:JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
46+
@get:JsonProperty("tags", required = false)
47+
val tags: kotlin.collections.List<Tag>? = null,
4348

4449
@Deprecated(message = "")
45-
@get:JsonProperty("status") val status: Pet.Status? = null
50+
@get:JsonProperty("status", required = false)
51+
val status: Pet.Status? = null
4652
) : Serializable {
4753

4854
/**

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ import javax.validation.Valid
2121
*/
2222
data class Tag(
2323

24-
@get:JsonProperty("id") val id: kotlin.Long? = null,
24+
@get:JsonProperty("id", required = false)
25+
val id: kotlin.Long? = null,
2526

26-
@get:JsonProperty("name") val name: kotlin.String? = null
27+
@get:JsonProperty("name", required = false)
28+
val name: kotlin.String? = null
2729
) : Serializable {
2830

2931
companion object {

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,29 @@ import javax.validation.Valid
2727
*/
2828
data class User(
2929

30-
@get:JsonProperty("id") val id: kotlin.Long? = null,
30+
@get:JsonProperty("id", required = false)
31+
val id: kotlin.Long? = null,
3132

32-
@get:JsonProperty("username") val username: kotlin.String? = null,
33+
@get:JsonProperty("username", required = false)
34+
val username: kotlin.String? = null,
3335

34-
@get:JsonProperty("firstName") val firstName: kotlin.String? = null,
36+
@get:JsonProperty("firstName", required = false)
37+
val firstName: kotlin.String? = null,
3538

36-
@get:JsonProperty("lastName") val lastName: kotlin.String? = null,
39+
@get:JsonProperty("lastName", required = false)
40+
val lastName: kotlin.String? = null,
3741

38-
@get:JsonProperty("email") val email: kotlin.String? = null,
42+
@get:JsonProperty("email", required = false)
43+
val email: kotlin.String? = null,
3944

40-
@get:JsonProperty("password") val password: kotlin.String? = null,
45+
@get:JsonProperty("password", required = false)
46+
val password: kotlin.String? = null,
4147

42-
@get:JsonProperty("phone") val phone: kotlin.String? = null,
48+
@get:JsonProperty("phone", required = false)
49+
val phone: kotlin.String? = null,
4350

44-
@get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null
51+
@get:JsonProperty("userStatus", required = false)
52+
val userStatus: kotlin.Int? = null
4553
) : Serializable {
4654

4755
companion object {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ import io.swagger.v3.oas.annotations.media.Schema
2020
*/
2121
data class Annotation(
2222

23-
@Schema(example = "null", description = "")
24-
@get:JsonProperty("id") val id: java.util.UUID? = null
23+
@Schema(example = "null", required = false, description = "")
24+
@get:JsonProperty("id", required = false)
25+
val id: java.util.UUID? = null
2526
) {
2627

2728
}

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

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,46 +39,59 @@ import io.swagger.v3.oas.annotations.media.Schema
3939
data class AnyOfUserOrPet(
4040

4141
@Schema(example = "null", required = true, description = "")
42-
@get:JsonProperty("username", required = true) val username: kotlin.String,
42+
@get:JsonProperty("username", required = true)
43+
val username: kotlin.String,
4344

4445
@Schema(example = "doggie", required = true, description = "")
45-
@get:JsonProperty("name", required = true) val name: kotlin.String,
46+
@get:JsonProperty("name", required = true)
47+
val name: kotlin.String,
4648

4749
@Schema(example = "null", required = true, description = "")
48-
@get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List<kotlin.String>,
50+
@get:JsonProperty("photoUrls", required = true)
51+
val photoUrls: kotlin.collections.List<kotlin.String>,
4952

50-
@Schema(example = "null", description = "")
51-
@get:JsonProperty("id") val id: kotlin.Long? = null,
53+
@Schema(example = "null", required = false, description = "")
54+
@get:JsonProperty("id", required = false)
55+
val id: kotlin.Long? = null,
5256

53-
@Schema(example = "null", description = "")
54-
@get:JsonProperty("firstName") val firstName: kotlin.String? = null,
57+
@Schema(example = "null", required = false, description = "")
58+
@get:JsonProperty("firstName", required = false)
59+
val firstName: kotlin.String? = null,
5560

56-
@Schema(example = "null", description = "")
57-
@get:JsonProperty("lastName") val lastName: kotlin.String? = null,
61+
@Schema(example = "null", required = false, description = "")
62+
@get:JsonProperty("lastName", required = false)
63+
val lastName: kotlin.String? = null,
5864

59-
@Schema(example = "null", description = "")
60-
@get:JsonProperty("email") val email: kotlin.String? = null,
65+
@Schema(example = "null", required = false, description = "")
66+
@get:JsonProperty("email", required = false)
67+
val email: kotlin.String? = null,
6168

62-
@Schema(example = "null", description = "")
63-
@get:JsonProperty("password") val password: kotlin.String? = null,
69+
@Schema(example = "null", required = false, description = "")
70+
@get:JsonProperty("password", required = false)
71+
val password: kotlin.String? = null,
6472

65-
@Schema(example = "null", description = "")
66-
@get:JsonProperty("phone") val phone: kotlin.String? = null,
73+
@Schema(example = "null", required = false, description = "")
74+
@get:JsonProperty("phone", required = false)
75+
val phone: kotlin.String? = null,
6776

68-
@Schema(example = "null", description = "User Status")
69-
@get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null,
77+
@Schema(example = "null", required = false, description = "User Status")
78+
@get:JsonProperty("userStatus", required = false)
79+
val userStatus: kotlin.Int? = null,
7080

7181
@field:Valid
72-
@Schema(example = "null", description = "")
73-
@get:JsonProperty("category") val category: Category? = null,
82+
@Schema(example = "null", required = false, description = "")
83+
@get:JsonProperty("category", required = false)
84+
val category: Category? = null,
7485

7586
@field:Valid
76-
@Schema(example = "null", description = "")
77-
@get:JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
87+
@Schema(example = "null", required = false, description = "")
88+
@get:JsonProperty("tags", required = false)
89+
val tags: kotlin.collections.List<Tag>? = null,
7890

79-
@Schema(example = "null", description = "pet status in the store")
91+
@Schema(example = "null", required = false, description = "pet status in the store")
8092
@Deprecated(message = "")
81-
@get:JsonProperty("status") val status: AnyOfUserOrPet.Status? = null
93+
@get:JsonProperty("status", required = false)
94+
val status: AnyOfUserOrPet.Status? = null
8295
) {
8396

8497
/**

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

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,46 +39,59 @@ import io.swagger.v3.oas.annotations.media.Schema
3939
data class AnyOfUserOrPetOrArrayString(
4040

4141
@Schema(example = "null", required = true, description = "")
42-
@get:JsonProperty("username", required = true) val username: kotlin.String,
42+
@get:JsonProperty("username", required = true)
43+
val username: kotlin.String,
4344

4445
@Schema(example = "doggie", required = true, description = "")
45-
@get:JsonProperty("name", required = true) val name: kotlin.String,
46+
@get:JsonProperty("name", required = true)
47+
val name: kotlin.String,
4648

4749
@Schema(example = "null", required = true, description = "")
48-
@get:JsonProperty("photoUrls", required = true) val photoUrls: kotlin.collections.List<kotlin.String>,
50+
@get:JsonProperty("photoUrls", required = true)
51+
val photoUrls: kotlin.collections.List<kotlin.String>,
4952

50-
@Schema(example = "null", description = "")
51-
@get:JsonProperty("id") val id: kotlin.Long? = null,
53+
@Schema(example = "null", required = false, description = "")
54+
@get:JsonProperty("id", required = false)
55+
val id: kotlin.Long? = null,
5256

53-
@Schema(example = "null", description = "")
54-
@get:JsonProperty("firstName") val firstName: kotlin.String? = null,
57+
@Schema(example = "null", required = false, description = "")
58+
@get:JsonProperty("firstName", required = false)
59+
val firstName: kotlin.String? = null,
5560

56-
@Schema(example = "null", description = "")
57-
@get:JsonProperty("lastName") val lastName: kotlin.String? = null,
61+
@Schema(example = "null", required = false, description = "")
62+
@get:JsonProperty("lastName", required = false)
63+
val lastName: kotlin.String? = null,
5864

59-
@Schema(example = "null", description = "")
60-
@get:JsonProperty("email") val email: kotlin.String? = null,
65+
@Schema(example = "null", required = false, description = "")
66+
@get:JsonProperty("email", required = false)
67+
val email: kotlin.String? = null,
6168

62-
@Schema(example = "null", description = "")
63-
@get:JsonProperty("password") val password: kotlin.String? = null,
69+
@Schema(example = "null", required = false, description = "")
70+
@get:JsonProperty("password", required = false)
71+
val password: kotlin.String? = null,
6472

65-
@Schema(example = "null", description = "")
66-
@get:JsonProperty("phone") val phone: kotlin.String? = null,
73+
@Schema(example = "null", required = false, description = "")
74+
@get:JsonProperty("phone", required = false)
75+
val phone: kotlin.String? = null,
6776

68-
@Schema(example = "null", description = "User Status")
69-
@get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null,
77+
@Schema(example = "null", required = false, description = "User Status")
78+
@get:JsonProperty("userStatus", required = false)
79+
val userStatus: kotlin.Int? = null,
7080

7181
@field:Valid
72-
@Schema(example = "null", description = "")
73-
@get:JsonProperty("category") val category: Category? = null,
82+
@Schema(example = "null", required = false, description = "")
83+
@get:JsonProperty("category", required = false)
84+
val category: Category? = null,
7485

7586
@field:Valid
76-
@Schema(example = "null", description = "")
77-
@get:JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
87+
@Schema(example = "null", required = false, description = "")
88+
@get:JsonProperty("tags", required = false)
89+
val tags: kotlin.collections.List<Tag>? = null,
7890

79-
@Schema(example = "null", description = "pet status in the store")
91+
@Schema(example = "null", required = false, description = "pet status in the store")
8092
@Deprecated(message = "")
81-
@get:JsonProperty("status") val status: AnyOfUserOrPetOrArrayString.Status? = null
93+
@get:JsonProperty("status", required = false)
94+
val status: AnyOfUserOrPetOrArrayString.Status? = null
8295
) {
8396

8497
/**

0 commit comments

Comments
 (0)