Skip to content

Commit 735d5ad

Browse files
[java-spring] provide a clarifying comment for the generated EnumConverterConfiguration class
1 parent b7fb3b2 commit 735d5ad

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

modules/openapi-generator/src/main/resources/JavaSpring/converter.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import org.springframework.context.annotation.Bean;
1212
import org.springframework.context.annotation.Configuration;
1313
import org.springframework.core.convert.converter.Converter;
1414

15+
/**
16+
* This class provides Spring Converter beans for the enum models in the OpenAPI specification.
17+
*
18+
* By default, Spring only converts primitive types to enums using Enum::valueOf, which can prevent
19+
* correct conversion if the OpenAPI specification is using an `enumPropertyNaming` other than
20+
* `original` or the specification has an integer enum.
21+
*/
1522
@Configuration(value = "{{configPackage}}.enumConverterConfiguration")
1623
public class EnumConverterConfiguration {
1724

0 commit comments

Comments
 (0)