Skip to content

Commit 2af405d

Browse files
update samples
1 parent 64ce1af commit 2af405d

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/configuration/EnumConverterConfiguration.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import org.springframework.context.annotation.Bean
66
import org.springframework.context.annotation.Configuration
77
import org.springframework.core.convert.converter.Converter
88

9+
/**
10+
* This class provides Spring Converter beans for the enum models in the OpenAPI specification.
11+
*
12+
* By default, Spring only converts primitive types to enums using Enum::valueOf, which can prevent
13+
* correct conversion if the OpenAPI specification is using an `enumPropertyNaming` other than
14+
* `original` or the specification has an integer enum.
15+
*/
916
@Configuration(value = "org.openapitools.configuration.enumConverterConfiguration")
1017
class EnumConverterConfiguration {
1118

samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/configuration/EnumConverterConfiguration.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import org.springframework.context.annotation.Bean
66
import org.springframework.context.annotation.Configuration
77
import org.springframework.core.convert.converter.Converter
88

9+
/**
10+
* This class provides Spring Converter beans for the enum models in the OpenAPI specification.
11+
*
12+
* By default, Spring only converts primitive types to enums using Enum::valueOf, which can prevent
13+
* correct conversion if the OpenAPI specification is using an `enumPropertyNaming` other than
14+
* `original` or the specification has an integer enum.
15+
*/
916
@Configuration(value = "org.openapitools.configuration.enumConverterConfiguration")
1017
class EnumConverterConfiguration {
1118

0 commit comments

Comments
 (0)