Skip to content

Commit 00f079c

Browse files
committed
add some default strings and fix test
1 parent e837d3e commit 00f079c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,9 @@ public void generateModelWithRequiredFalseWithDefaults() throws Exception {
10931093
"@get:JsonProperty(\"category\", required = false)",
10941094
"override val category: Category? = null", // without default (fallback) value is nullable
10951095
"@get:JsonProperty(\"nonRequiredWithDefaultList\", required = false)",
1096-
"override val nonRequiredWithDefaultList: kotlin.collections.List<kotlin.String> = arrayListOf()", // elsewhere with default (fallback) value is not nullable
1096+
"override val nonRequiredWithDefaultList: kotlin.collections.List<kotlin.String> = arrayListOf(\"just some default string\",\"another default string\"),", // elsewhere with default (fallback) value is not nullable
10971097
"@get:JsonProperty(\"nonRequiredWithDefaultSet\", required = false)",
1098-
"override val nonRequiredWithDefaultSet: kotlin.collections.Set<kotlin.String> = setOf()",
1098+
"override val nonRequiredWithDefaultSet: kotlin.collections.Set<kotlin.String> = setOf(\"more strings\",\"look, it's a string!\")",
10991099
"@get:JsonProperty(\"nonRequiredWithDefaultString\", required = false)",
11001100
"override val nonRequiredWithDefaultString: kotlin.String = \"defaultValue\"",
11011101
"@get:JsonProperty(\"nonRequiredWithDefaultInt\", required = false)",

modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,13 @@ components:
527527
type: array
528528
items:
529529
type: string
530-
default: [ ]
530+
default: [ "just some default string", "another default string" ]
531531
nonRequiredWithDefaultSet:
532532
type: array
533533
items:
534534
type: string
535535
uniqueItems: true
536-
default: [ ]
536+
default: [ "more strings", "look, it's a string!" ]
537537
nonRequiredWithDefaultString:
538538
type: string
539539
default: defaultValue

0 commit comments

Comments
 (0)