diff --git a/bin/configs/kotlin-spring-boot-integer-enum.yaml b/bin/configs/kotlin-spring-boot-integer-enum.yaml
index 0b23e72b5bf6..bf7c62c6a0c4 100644
--- a/bin/configs/kotlin-spring-boot-integer-enum.yaml
+++ b/bin/configs/kotlin-spring-boot-integer-enum.yaml
@@ -11,4 +11,5 @@ additionalProperties:
annotationLibrary: none
documentationProvider: none
enumPropertyNaming: UPPERCASE
+ enumUnknownDefaultCase: "true"
useEnumValueInterface: "true"
diff --git a/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml b/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml
index 235978710b26..c0e2aabcfa26 100644
--- a/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml
+++ b/bin/configs/kotlin-spring-boot-oneof-enum-discriminator.yaml
@@ -9,3 +9,4 @@ additionalProperties:
useSwaggerUI: "false"
interfaceOnly: "true"
useSpringBoot3: "true"
+ enumUnknownDefaultCase: "true"
diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md
index a636658d17f4..1e25ae5c57f5 100644
--- a/docs/generators/kotlin-spring.md
+++ b/docs/generators/kotlin-spring.md
@@ -32,6 +32,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|documentationProvider|Select the OpenAPI documentation provider.|
- **none**
- Do not publish an OpenAPI specification.
- **source**
- Publish the original input OpenAPI specification.
- **springdoc**
- Generate an OpenAPI 3 specification using SpringDoc.
|springdoc|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', 'original', and 'bestEffortBacktick' (like 'original' but tries to wrap values in backticks before falling back to sanitizing, e.g. `name,asc` stays `name,asc` rather than becoming nameCommaAsc; useful for sort/order enums)| |original|
+|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.| |false|
|exceptionHandler|generate default global exception handlers (not compatible with reactive. enabling reactive will disable exceptionHandler )| |true|
|generatePageableConstraintValidation|Generate a @ValidPageable annotation and PageableConstraintValidator class, and apply @ValidPageable to the injected Pageable parameter of operations whose 'page' or 'size' parameter specifies a maximum constraint. The annotation enforces those constraints on the Pageable object that replaces the individual page/size query parameters. Requires useBeanValidation=true and library=spring-boot.| |false|
|generateSortValidation|Generate a @ValidSort annotation and SortValidator class, and apply @ValidSort to the injected Pageable parameter of operations whose 'sort' parameter has enum values. The annotation validates that sort values in the Pageable object match the allowed enum values from the spec. Requires useBeanValidation=true and library=spring-boot.| |false|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
index 619d44868dc4..45ba7dcd10ca 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java
@@ -315,6 +315,8 @@ public KotlinSpringServerCodegen() {
addSwitch(COMPANION_OBJECT, "Whether to generate companion objects in data classes, enabling companion extensions.", companionObject);
addSwitch(SUSPEND_FUNCTIONS, "Whether to generate suspend functions for API operations. Useful for Spring MVC with Kotlin coroutines without requiring the full reactive stack.", suspendFunctions);
cliOptions.add(CliOption.newBoolean(CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES, CodegenConstants.USE_DEDUCTION_FOR_ONE_OF_INTERFACES_DESC, useDeductionForOneOfInterfaces));
+ cliOptions.add(CliOption.newBoolean(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE_DESC).defaultValue("false"));
+
addSwitch(CodegenConstants.USE_ENUM_VALUE_INTERFACE, CodegenConstants.USE_ENUM_VALUE_INTERFACE_DESC, useEnumValueInterface);
addSwitch(CodegenConstants.OPENAPI_NULLABLE,
"Enable OpenAPI Jackson Nullable library (jackson-databind-nullable) for strict null handling. "
@@ -673,6 +675,11 @@ public void processOpts() {
}
writePropertyBack(SKIP_DEFAULT_INTERFACE, skipDefaultInterface);
+
+ if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) {
+ setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties.get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString()));
+ }
+
if (additionalProperties.containsKey(REACTIVE)) {
if (SPRING_CLOUD_LIBRARY.equals(library)) {
throw new IllegalArgumentException("Currently, reactive option doesn't supported by Spring Cloud");
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache
index 3eeb19e70bcd..8a6d32cbdfab 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache
@@ -49,15 +49,26 @@
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
*/
enum class {{{nameInPascalCase}}}(@get:JsonValue {{#useEnumValueInterface}}{{^isContainer}}override {{/isContainer}}{{/useEnumValueInterface}}val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) {{#vendorExtensions.x-kotlin-implements}}{{#-first}}: {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}} {{/vendorExtensions.x-kotlin-implements}}{
-{{#allowableValues}}{{#enumVars}}
- {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}};
+ {{#allowableValues}}{{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
+ {{/enumVars}}{{/allowableValues}}
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}): {{{nameInPascalCase}}} {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
+ {{#enumUnknownDefaultCase}}
+ {{#allowableValues}}
+ {{#enumVars}}
+ {{#-last}}
+ ?: {{{name}}}
+ {{/-last}}
+ {{/enumVars}}
+ {{/allowableValues}}
+ {{/enumUnknownDefaultCase}}
+ {{^enumUnknownDefaultCase}}
?: throw IllegalArgumentException("Unexpected value '$value' for enum '{{nameInPascalCase}}'")
+ {{/enumUnknownDefaultCase}}
}
}
}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache
index d22051e2367a..56e7293755d9 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-spring/enumClass.mustache
@@ -1,17 +1,28 @@
/**
-* {{{description}}}
-* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
-*/
-enum class {{classname}}(@get:JsonValue {{#useEnumValueInterface}}override {{/useEnumValueInterface}}val value: {{dataType}}) {{#vendorExtensions.x-kotlin-implements}}{{#-first}}: {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}} {{/vendorExtensions.x-kotlin-implements}}{
-{{#allowableValues}}{{#enumVars}}
- {{&name}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}};
+ * {{{description}}}
+ * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
+ */
+enum class {{classname}}(@get:JsonValue {{#useEnumValueInterface}}override {{/useEnumValueInterface}}val value: {{dataType}}){{#vendorExtensions.x-kotlin-implements}}{{#-first}} : {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-kotlin-implements}} {
+{{#allowableValues}}{{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
+{{/enumVars}}{{/allowableValues}}
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: {{dataType}}): {{classname}} {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum '{{classname}}'")
+ return values().firstOrNull{ it.value == value }
+ {{#enumUnknownDefaultCase}}
+ {{#allowableValues}}
+ {{#enumVars}}
+ {{#-last}}
+ ?: {{&name}}
+ {{/-last}}
+ {{/enumVars}}
+ {{/allowableValues}}
+ {{/enumUnknownDefaultCase}}
+ {{^enumUnknownDefaultCase}}
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum '{{classname}}'")
+ {{/enumUnknownDefaultCase}}
}
}
-}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java
index 7fbc5ceea289..efb3e325ca71 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java
@@ -4,6 +4,7 @@
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
+import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.apache.commons.io.FileUtils;
@@ -11,6 +12,8 @@
import org.jetbrains.annotations.NotNull;
import org.openapitools.codegen.ClientOptInput;
import org.openapitools.codegen.CodegenConstants;
+import org.openapitools.codegen.CodegenModel;
+import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.DefaultGenerator;
import org.openapitools.codegen.TestUtils;
import org.openapitools.codegen.config.CodegenConfigurator;
@@ -23,6 +26,8 @@
import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.AnnotationLibrary;
import org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DocumentationProvider;
import org.openapitools.codegen.languages.features.SwaggerUIFeatures;
+import org.openapitools.codegen.model.ModelsMap;
+import org.openapitools.codegen.model.ModelMap;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@@ -6778,6 +6783,100 @@ public void schemaMappingWithNullableAllOfRendersNullableKotlinProperty() throws
assertThat(content).contains("com.example.ExternalModel?");
}
+ @Test(description = "test enumUnknownDefaultCase option")
+ public void testEnumUnknownDefaultCaseOption() {
+ final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
+
+ // Test default value is false
+ codegen.processOpts();
+ Assert.assertEquals(codegen.getEnumUnknownDefaultCase(), Boolean.FALSE);
+
+ // Test setting via additionalProperties
+ codegen.additionalProperties().put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, "true");
+ codegen.processOpts();
+ Assert.assertEquals(codegen.getEnumUnknownDefaultCase(), Boolean.TRUE);
+ }
+
+ @Test(description = "test enum generation with enumUnknownDefaultCase enabled")
+ public void testEnumGenerationWithUnknownDefaultCase() throws IOException {
+ Map files = generateFromContract(
+ "src/test/resources/3_1/enum_unknown_default_case.yaml",
+ Map.of(
+ CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, true
+ ),
+ new HashMap<>(),
+ configurator -> {}
+ );
+
+ File colorFile = files.get("ColorEnum.kt");
+ assertThat(colorFile).isNotNull();
+
+ String content = Files.readString(colorFile.toPath());
+
+ assertThat(content).contains("unknown_default_open_api(\"unknown_default_open_api\")");
+ assertThat(content).contains("?: unknown_default_open_api");
+ }
+
+ @Test(description = "test enum generation with enumUnknownDefaultCase disabled")
+ public void testEnumGenerationWithoutUnknownDefaultCase() throws IOException {
+ Map files = generateFromContract(
+ "src/test/resources/3_1/enum_unknown_default_case.yaml",
+ Map.of(
+ CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, false
+ ),
+ new HashMap<>(),
+ configurator -> {}
+ );
+
+ File colorFile = files.get("ColorEnum.kt");
+ assertThat(colorFile).isNotNull();
+
+ String content = Files.readString(colorFile.toPath());
+
+ assertThat(content).doesNotContain("unknown_default_open_api(\"unknown_default_open_api\")");
+ assertThat(content).doesNotContain("?: unknown_default_open_api");
+ }
+
+ @Test(description = "test data class generation containing inline enum with enumUnknownDefaultCase enabled")
+ public void testDataClassGenerationWithUnknownDefaultCase() throws IOException {
+ Map files = generateFromContract(
+ "src/test/resources/3_1/dataclass_unknown_default_case.yaml",
+ Map.of(
+ CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, true
+ ),
+ new HashMap<>(),
+ configurator -> {}
+ );
+
+ File colorResponseFile = files.get("ColorResponse.kt");
+ assertThat(colorResponseFile).isNotNull();
+
+ String content = Files.readString(colorResponseFile.toPath());
+
+ assertThat(content).contains("unknown_default_open_api(\"unknown_default_open_api\")");
+ assertThat(content).contains("?: unknown_default_open_api");
+ }
+
+ @Test(description = "test data class generation containing inline enum with enumUnknownDefaultCase disabled")
+ public void testDataClassGenerationWithoutUnknownDefaultCase() throws IOException {
+ Map files = generateFromContract(
+ "src/test/resources/3_1/dataclass_unknown_default_case.yaml",
+ Map.of(
+ CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, false
+ ),
+ new HashMap<>(),
+ configurator -> {}
+ );
+
+ File colorResponseFile = files.get("ColorResponse.kt");
+ assertThat(colorResponseFile).isNotNull();
+
+ String content = Files.readString(colorResponseFile.toPath());
+
+ assertThat(content).doesNotContain("unknown_default_open_api(\"unknown_default_open_api\")");
+ assertThat(content).doesNotContain("?: unknown_default_open_api");
+ }
+
@Test(description = "nameMappings: @param:JsonProperty must use the original JSON field name for deserialization")
public void paramJsonPropertyAnnotationWithNameMappings() throws IOException {
// When a property is renamed via nameMappings, @param:JsonProperty must carry the
diff --git a/modules/openapi-generator/src/test/resources/3_1/dataclass_unknown_default_case.yaml b/modules/openapi-generator/src/test/resources/3_1/dataclass_unknown_default_case.yaml
new file mode 100644
index 000000000000..ce5711a2e043
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_1/dataclass_unknown_default_case.yaml
@@ -0,0 +1,39 @@
+openapi: 3.0.0
+info:
+ title: Dataclass Nested Enum Test API
+ description: API for testing inline/nested enum generation in data classes with enumUnknownDefaultCase
+ version: 1.0.0
+paths:
+ /colors:
+ get:
+ summary: Get color
+ operationId: getColor
+ responses:
+ '200':
+ description: Successful response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ColorResponse'
+components:
+ schemas:
+ ColorResponse:
+ type: object
+ required:
+ - color
+ properties:
+ color:
+ type: string
+ description: Available colors
+ enum:
+ - RED
+ - GREEN
+ - BLUE
+ - YELLOW
+ priority:
+ type: integer
+ description: Priority levels
+ enum:
+ - 1
+ - 2
+ - 3
diff --git a/modules/openapi-generator/src/test/resources/3_1/enum_unknown_default_case.yaml b/modules/openapi-generator/src/test/resources/3_1/enum_unknown_default_case.yaml
new file mode 100644
index 000000000000..05f23cbaef7b
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_1/enum_unknown_default_case.yaml
@@ -0,0 +1,56 @@
+openapi: 3.0.0
+info:
+ title: Enum Test API
+ description: API for testing enum generation with enumUnknownDefaultCase
+ version: 1.0.0
+paths:
+ /colors:
+ get:
+ summary: Get color
+ operationId: getColor
+ responses:
+ '200':
+ description: Successful response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ColorResponse'
+components:
+ schemas:
+ ColorResponse:
+ type: object
+ required:
+ - color
+ - status
+ properties:
+ color:
+ $ref: '#/components/schemas/ColorEnum'
+ status:
+ $ref: '#/components/schemas/StatusEnum'
+ priority:
+ $ref: '#/components/schemas/PriorityEnum'
+ ColorEnum:
+ type: string
+ description: Available colors
+ enum:
+ - RED
+ - GREEN
+ - BLUE
+ - YELLOW
+ StatusEnum:
+ type: string
+ description: Status values
+ enum:
+ - PENDING
+ - APPROVED
+ - REJECTED
+ - IN_PROGRESS
+ PriorityEnum:
+ type: integer
+ description: Priority levels
+ enum:
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
\ No newline at end of file
diff --git a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt
index d5af2e05d658..14dd844fc2f5 100644
--- a/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt
+++ b/samples/server/others/kotlin-springboot/oneOf-discriminator-const/src/main/kotlin/org/openapitools/model/Cat.kt
@@ -42,12 +42,12 @@ data class Cat(
lazy("lazy"),
adventurous("adventurous"),
aggressive("aggressive");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): HuntingSkill {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'HuntingSkill'")
}
}
diff --git a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/VehicleType.kt b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/VehicleType.kt
index 400f44e12a77..00645a4bd7d0 100644
--- a/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/VehicleType.kt
+++ b/samples/server/others/kotlin-springboot/oneOf-enum-discriminator/src/main/kotlin/org/openapitools/model/VehicleType.kt
@@ -15,21 +15,21 @@ import jakarta.validation.constraints.Size
import jakarta.validation.Valid
/**
-*
-* Values: CAR,TRUCK
-*/
+ *
+ * Values: CAR,TRUCK,unknown_default_open_api
+ */
enum class VehicleType(@get:JsonValue val value: kotlin.String) {
CAR("CAR"),
- TRUCK("TRUCK");
+ TRUCK("TRUCK"),
+ unknown_default_open_api("unknown_default_open_api");
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): VehicleType {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'VehicleType'")
+ return values().firstOrNull{ it.value == value }
+ ?: unknown_default_open_api
}
}
}
-
diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt
index c185ea107046..91789e073342 100644
--- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt
index 978290446045..fa87046fcbb6 100644
--- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -69,12 +69,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Order.kt
index 858d62c81958..a5bbc6f533b7 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt
index 1f4269d35cca..4946608b9073 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-bean-validation/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt
index 858d62c81958..a5bbc6f533b7 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt
index 1f4269d35cca..4946608b9073 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt
index 858d62c81958..a5bbc6f533b7 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt
index 1f4269d35cca..4946608b9073 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt
index 858d62c81958..a5bbc6f533b7 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt
index 1f4269d35cca..4946608b9073 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt
index 858d62c81958..a5bbc6f533b7 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt
index 1f4269d35cca..4946608b9073 100644
--- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt
index 5344311246f7..4287b455a617 100644
--- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt
+++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPet.kt
@@ -125,12 +125,12 @@ data class AnyOfUserOrPet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt
index 60d2f3bc9c93..65466254982f 100644
--- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt
+++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/AnyOfUserOrPetOrArrayString.kt
@@ -125,12 +125,12 @@ data class AnyOfUserOrPetOrArrayString(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt
index fc6ac8284963..3c937a7f51ec 100644
--- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt
index 1a5fa08a8a18..50e293ffbca8 100644
--- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Order.kt
index 79363b092edf..9c18c1538b4d 100644
--- a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Order.kt
@@ -70,12 +70,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt
index 0de23f8edb3c..587856ead5b5 100644
--- a/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-spring-sealed-interfaces/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -72,12 +72,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt
index 486848e14599..df8a5532d04a 100644
--- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt
index 56c523367969..066dcdb1e2a8 100644
--- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -69,12 +69,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt
index 486848e14599..df8a5532d04a 100644
--- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt
index 56c523367969..066dcdb1e2a8 100644
--- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -69,12 +69,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Order.kt
index 486848e14599..df8a5532d04a 100644
--- a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt
index 56c523367969..066dcdb1e2a8 100644
--- a/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-4/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -69,12 +69,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt
index 486848e14599..df8a5532d04a 100644
--- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt
index c076750eb99a..ac440b3ce86f 100644
--- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -69,12 +69,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt
index 0744ff2d4e47..fbb38c8027c0 100644
--- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt
index e10512ead290..cc56831a201b 100644
--- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt
index fc6ac8284963..3c937a7f51ec 100644
--- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt
index 1466d9480ad8..f2290d28be46 100644
--- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt
index 13da2b5afecf..7ea29ba5043a 100644
--- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt
+++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt
@@ -16,10 +16,10 @@ import javax.validation.Valid
import io.swagger.annotations.ApiModelProperty
/**
-*
-* Values: black,white,brown,yellow,violet
-*/
-enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods , java.io.Serializable {
+ *
+ * Values: black,white,brown,yellow,violet
+ */
+enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods, java.io.Serializable {
black("black"),
white("white"),
@@ -31,9 +31,8 @@ enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDe
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Color {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Color'")
+ return values().firstOrNull{ it.value == value }
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Color'")
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt
index 2a51c2aae5da..31959dc670dd 100644
--- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt
+++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt
@@ -99,12 +99,12 @@ data class Dog(
Husky("Husky"),
Retriever("Retriever"),
Shepherd("Shepherd");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Breed {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Breed'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt
index f4f0ff415e06..53c65bba6977 100644
--- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt
index c7effc69943c..d10cfbac5ee9 100644
--- a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt
+++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ApiError.kt
@@ -38,19 +38,20 @@ data class ApiError(
/**
*
- * Values: OK,ERROR
+ * Values: OK,ERROR,UNKNOWN_DEFAULT_OPEN_API
*/
enum class ErrorCode(@get:JsonValue override val value: kotlin.Int) : ValuedEnum {
OK(0),
- ERROR(100);
-
+ ERROR(100),
+ UNKNOWN_DEFAULT_OPEN_API(11184809);
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.Int): ErrorCode {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'ErrorCode'")
+ return values().firstOrNull{ it.value == value }
+ ?: UNKNOWN_DEFAULT_OPEN_API
}
}
}
diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt
index 96efb7984c28..6f1ff2ec755e 100644
--- a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt
+++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/model/ReasonCode.kt
@@ -16,21 +16,21 @@ import jakarta.validation.constraints.Size
import jakarta.validation.Valid
/**
-*
-* Values: _10,_20
-*/
+ *
+ * Values: _10,_20,UNKNOWN_DEFAULT_OPEN_API
+ */
enum class ReasonCode(@get:JsonValue override val value: kotlin.Int) : ValuedEnum {
_10(10),
- _20(20);
+ _20(20),
+ UNKNOWN_DEFAULT_OPEN_API(11184809);
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.Int): ReasonCode {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'ReasonCode'")
+ return values().firstOrNull{ it.value == value }
+ ?: UNKNOWN_DEFAULT_OPEN_API
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt
index bf17370744c9..60e6cec6d40d 100644
--- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt
index 5acd72ff27ae..bc14afd22e3b 100644
--- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -75,12 +75,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt
index a84813d0ee44..573747822a16 100644
--- a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt
+++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt
@@ -16,9 +16,9 @@ import javax.validation.Valid
import io.swagger.v3.oas.annotations.media.Schema
/**
-* additional field as Enum
-* Values: ALLOWED,IN_PROGRESS,REJECTED
-*/
+ * additional field as Enum
+ * Values: ALLOWED,IN_PROGRESS,REJECTED
+ */
enum class MultipartMixedStatus(@get:JsonValue val value: kotlin.String) {
ALLOWED("ALLOWED"),
@@ -29,9 +29,8 @@ enum class MultipartMixedStatus(@get:JsonValue val value: kotlin.String) {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): MultipartMixedStatus {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'MultipartMixedStatus'")
+ return values().firstOrNull{ it.value == value }
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'MultipartMixedStatus'")
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt
index c185ea107046..91789e073342 100644
--- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt
index d5959182a70f..f1d20a300b8e 100644
--- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -68,12 +68,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt
index c185ea107046..91789e073342 100644
--- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt
@@ -68,12 +68,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt
index d5959182a70f..f1d20a300b8e 100644
--- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -68,12 +68,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PetSort.kt b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PetSort.kt
index b4d4e2ee3a9d..eb770dcccdc5 100644
--- a/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PetSort.kt
+++ b/samples/server/petstore/kotlin-springboot-paged-model/src/main/kotlin/org/openapitools/model/PetSort.kt
@@ -15,9 +15,9 @@ import jakarta.validation.constraints.Size
import jakarta.validation.Valid
/**
-*
-* Values: idCommaAsc,idCommaDesc,nameCommaAsc,nameCommaDesc
-*/
+ *
+ * Values: idCommaAsc,idCommaDesc,nameCommaAsc,nameCommaDesc
+ */
enum class PetSort(@get:JsonValue val value: kotlin.String) : java.io.Serializable {
idCommaAsc("id,asc"),
@@ -29,9 +29,8 @@ enum class PetSort(@get:JsonValue val value: kotlin.String) : java.io.Serializab
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): PetSort {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'PetSort'")
+ return values().firstOrNull{ it.value == value }
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'PetSort'")
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Order.kt
index fc6ac8284963..3c937a7f51ec 100644
--- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt
index 1466d9480ad8..f2290d28be46 100644
--- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt
index fc6ac8284963..3c937a7f51ec 100644
--- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt
index 1466d9480ad8..f2290d28be46 100644
--- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -76,12 +76,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt
index f2c26ec7f2d9..46302ed38a33 100644
--- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt
index 09fe219134cc..c40862b7506d 100644
--- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -75,12 +75,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSort.kt b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSort.kt
index 06ce004b5a90..ca149cdefedf 100644
--- a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSort.kt
+++ b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSort.kt
@@ -15,9 +15,9 @@ import jakarta.validation.constraints.Size
import jakarta.validation.Valid
/**
-*
-* Values: idCommaAsc,idCommaDesc,createdAtCommaAsc,createdAtCommaDesc
-*/
+ *
+ * Values: idCommaAsc,idCommaDesc,createdAtCommaAsc,createdAtCommaDesc
+ */
enum class PetSort(@get:JsonValue val value: kotlin.String) : java.io.Serializable {
idCommaAsc("id,asc"),
@@ -29,9 +29,8 @@ enum class PetSort(@get:JsonValue val value: kotlin.String) : java.io.Serializab
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): PetSort {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'PetSort'")
+ return values().firstOrNull{ it.value == value }
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'PetSort'")
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSortEnum.kt b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSortEnum.kt
index a8bb6d27cbc9..81daf5870824 100644
--- a/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSortEnum.kt
+++ b/samples/server/petstore/kotlin-springboot-sort-validation/src/main/kotlin/org/openapitools/model/PetSortEnum.kt
@@ -15,9 +15,9 @@ import jakarta.validation.constraints.Size
import jakarta.validation.Valid
/**
-*
-* Values: nameCommaAsc,nameCommaDesc,idCommaAsc,idCommaDesc
-*/
+ *
+ * Values: nameCommaAsc,nameCommaDesc,idCommaAsc,idCommaDesc
+ */
enum class PetSortEnum(@get:JsonValue val value: kotlin.String) : java.io.Serializable {
nameCommaAsc("name,asc"),
@@ -29,9 +29,8 @@ enum class PetSortEnum(@get:JsonValue val value: kotlin.String) : java.io.Serial
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): PetSortEnum {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'PetSortEnum'")
+ return values().firstOrNull{ it.value == value }
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'PetSortEnum'")
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt
index 614fab54815b..3b75e2d91245 100644
--- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt
index 295de4980629..989e6f1049d0 100644
--- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -75,12 +75,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt
index df21eb4eb9a7..6fef8c05c5df 100644
--- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt
index 3452e53fc80d..618ce8582286 100644
--- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -75,12 +75,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt
index 13da2b5afecf..7ea29ba5043a 100644
--- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt
+++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt
@@ -16,10 +16,10 @@ import javax.validation.Valid
import io.swagger.annotations.ApiModelProperty
/**
-*
-* Values: black,white,brown,yellow,violet
-*/
-enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods , java.io.Serializable {
+ *
+ * Values: black,white,brown,yellow,violet
+ */
+enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods, java.io.Serializable {
black("black"),
white("white"),
@@ -31,9 +31,8 @@ enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDe
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Color {
- return values().firstOrNull{it -> it.value == value}
- ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Color'")
+ return values().firstOrNull{ it.value == value }
+ ?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Color'")
}
}
}
-
diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt
index 9ad790589a79..f4bdec2e41f9 100644
--- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt
+++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt
@@ -99,12 +99,12 @@ data class Dog(
Husky("Husky"),
Retriever("Retriever"),
Shepherd("Shepherd");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Breed {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Breed'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt
index f4f0ff415e06..53c65bba6977 100644
--- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt
@@ -75,12 +75,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt
index 05b5fbbae3f3..2b9d73689388 100644
--- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt
+++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt
@@ -69,12 +69,12 @@ data class Order(
placed("placed"),
approved("approved"),
delivered("delivered");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}
diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt
index a94d6438c2b5..5e608f71cee4 100644
--- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt
+++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt
@@ -69,12 +69,12 @@ data class Pet(
available("available"),
pending("pending"),
sold("sold");
-
+
companion object {
@JvmStatic
@JsonCreator
fun forValue(value: kotlin.String): Status {
- return values().firstOrNull{it -> it.value == value}
+ return values().firstOrNull{ it.value == value }
?: throw IllegalArgumentException("Unexpected value '$value' for enum 'Status'")
}
}