33import java .util .Map ;
44import java .util .Optional ;
55
6- import io .quarkus .runtime .annotations .ConfigGroup ;
7- import io .quarkus .runtime .annotations .ConfigItem ;
6+ import io .smallrye .config .WithName ;
87
98/*
109 * Model for the configuration of this extension.
1312 * Not meant to be used outside this scope.
1413 * Config items can be applied on spec and globally as well
1514 */
16- @ ConfigGroup
17- public class CommonItemConfig {
15+ public interface CommonItemConfig {
1816
1917 /**
2018 * Whether to skip the generation of models for form parameters
2119 */
22- @ ConfigItem ( name = "skip-form-model" )
23- public Optional <Boolean > skipFormModel ;
20+ @ WithName ( "skip-form-model" )
21+ Optional <Boolean > skipFormModel () ;
2422
2523 /**
2624 * Type Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be used for a
2725 * given OAS datatype (the keys of this map)
2826 */
29- @ ConfigItem ( name = "type-mappings" )
30- public Map <String , String > typeMappings ;
27+ @ WithName ( "type-mappings" )
28+ Map <String , String > typeMappings () ;
3129
3230 /**
3331 * Import Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be
3432 * imported when a given OAS datatype (the keys of this map) is used
3533 */
36- @ ConfigItem ( name = "import-mappings" )
37- public Map <String , String > importMappings ;
34+ @ WithName ( "import-mappings" )
35+ Map <String , String > importMappings () ;
3836
3937 /**
4038 * Schema Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be
4139 * imported when a given schema type (the keys of this map) is used
4240 */
43- @ ConfigItem ( name = "schema-mappings" )
44- public Map <String , String > schemaMappings ;
41+ @ WithName ( "schema-mappings" )
42+ Map <String , String > schemaMappings () ;
4543
4644 /**
4745 * The specified annotations will be added to the generated model files
4846 */
49- @ ConfigItem ( name = "additional-model-type-annotations" )
50- public Optional <String > additionalModelTypeAnnotations ;
47+ @ WithName ( "additional-model-type-annotations" )
48+ Optional <String > additionalModelTypeAnnotations () ;
5149
5250 /**
5351 * Defines if the enums should have an `UNEXPECTED` member to convey values that cannot be parsed. Default is
5452 * {@code false}.
5553 */
56- @ ConfigItem ( name = "additional-enum-type-unexpected-member" )
57- public Optional <Boolean > additionalEnumTypeUnexpectedMemberAnnotations ;
54+ @ WithName ( "additional-enum-type-unexpected-member" )
55+ Optional <Boolean > additionalEnumTypeUnexpectedMemberAnnotations () ;
5856
5957 /**
6058 * The specified annotations will be added to the generated api files
6159 */
62- @ ConfigItem ( name = "additional-api-type-annotations" )
63- public Optional <String > additionalApiTypeAnnotations ;
60+ @ WithName ( "additional-api-type-annotations" )
61+ Optional <String > additionalApiTypeAnnotations () ;
6462
6563 /**
6664 * Add custom/additional HTTP Headers or other args to every request
6765 */
68- @ ConfigItem ( name = "additional-request-args" )
69- public Optional <String > additionalRequestArgs ;
66+ @ WithName ( "additional-request-args" )
67+ Optional <String > additionalRequestArgs () ;
7068
7169 /**
7270 * Defines if the methods should return {@link jakarta.ws.rs.core.Response} or a model. Default is {@code false}.
7371 */
74- @ ConfigItem ( name = "return-response" )
75- public Optional <Boolean > returnResponse ;
72+ @ WithName ( "return-response" )
73+ Optional <Boolean > returnResponse () ;
7674
7775 /**
7876 * Defines if security support classes should be generated
7977 */
80- @ ConfigItem ( name = "enable-security-generation" )
81- public Optional <String > enableSecurityGeneration ;
78+ @ WithName ( "enable-security-generation" )
79+ Optional <String > enableSecurityGeneration () ;
8280
8381 /**
8482 * Defines the normalizer options.
8583 */
86- @ ConfigItem ( name = "open-api-normalizer" )
87- public Map <String , String > normalizer ;
84+ @ WithName ( "open-api-normalizer" )
85+ Map <String , String > normalizer () ;
8886
8987 /**
9088 * Enable SmallRye Mutiny support. If you set this to {@code true}, all return types will be wrapped in
9189 * {@link io.smallrye.mutiny.Uni}.
9290 */
93- @ ConfigItem ( name = "mutiny" )
94- public Optional <Boolean > supportMutiny ;
91+ @ WithName ( "mutiny" )
92+ Optional <Boolean > supportMutiny () ;
9593
9694 /**
9795 * Defines with SmallRye Mutiny enabled if methods should return {@link jakarta.ws.rs.core.Response} or a model. Default is
9896 * {@code false}.
9997 */
100- @ ConfigItem ( name = "mutiny.return-response" )
101- public Optional <Boolean > mutinyReturnResponse ;
98+ @ WithName ( "mutiny.return-response" )
99+ Optional <Boolean > mutinyReturnResponse () ;
102100
103101 /**
104102 * Handles the return type for each operation, depending on the configuration.
@@ -125,16 +123,16 @@ public class CommonItemConfig {
125123 * - If the operation has a void return type, it will return {@link io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response>}.
126124 * - Otherwise, it will return {@link io.smallrye.mutiny.Uni<returnType>}`.
127125 */
128- @ ConfigItem ( name = "mutiny.operation-ids" )
129- public Optional < Map <String , String >> mutinyMultiOperationIds ;
126+ @ WithName ( "mutiny.operation-ids" )
127+ Map <String , String > mutinyMultiOperationIds () ;
130128
131129 /**
132130 * Defines, whether the `PartFilename` ({@link org.jboss.resteasy.reactive.PartFilename} or
133131 * {@link org.jboss.resteasy.annotations.providers.multipart.PartFilename}) annotation should be generated for
134132 * MultipartForm POJOs. By setting to {@code false}, the annotation will not be generated.
135133 */
136- @ ConfigItem ( name = "generate-part-filename" )
137- public Optional <Boolean > generatePartFilename ;
134+ @ WithName ( "generate-part-filename" )
135+ Optional <Boolean > generatePartFilename () ;
138136
139137 /**
140138 * Defines the filename for a part in case the `PartFilename` annotation
@@ -143,40 +141,40 @@ public class CommonItemConfig {
143141 * In case no value is set, the default one is `<fieldName>File` or `file`, depending on the
144142 * {@link CommonItemConfig#useFieldNameInPartFilename} configuration.
145143 */
146- @ ConfigItem ( name = "part-filename-value" )
147- public Optional <String > partFilenameValue ;
144+ @ WithName ( "part-filename-value" )
145+ Optional <String > partFilenameValue () ;
148146
149147 /**
150148 * Defines, whether the filename should also include the property name in case the `PartFilename` annotation
151149 * ({@link org.jboss.resteasy.reactive.PartFilename} or
152150 * {@link org.jboss.resteasy.annotations.providers.multipart.PartFilename}) is generated.
153151 */
154- @ ConfigItem ( name = "use-field-name-in-part-filename" )
155- public Optional <Boolean > useFieldNameInPartFilename ;
152+ @ WithName ( "use-field-name-in-part-filename" )
153+ Optional <Boolean > useFieldNameInPartFilename () ;
156154
157155 /**
158156 * Enable bean validation. If you set this to {@code true}, validation annotations are added to generated sources E.g.
159157 * {@code @Size}.
160158 */
161- @ ConfigItem ( name = "use-bean-validation" )
162- public Optional <Boolean > useBeanValidation ;
159+ @ WithName ( "use-bean-validation" )
160+ Optional <Boolean > useBeanValidation () ;
163161
164162 /**
165163 * Enable the generation of APIs. If you set this to {@code false}, APIs will not be generated.
166164 */
167- @ ConfigItem ( name = "generate-apis" )
168- public Optional <Boolean > generateApis ;
165+ @ WithName ( "generate-apis" )
166+ Optional <Boolean > generateApis () ;
169167
170168 /**
171169 * Enable the generation of models. If you set this to {@code false}, models will not be generated.
172170 */
173- @ ConfigItem ( name = "generate-models" )
174- public Optional <Boolean > generateModels ;
171+ @ WithName ( "generate-models" )
172+ Optional <Boolean > generateModels () ;
175173
176174 /**
177175 * Enable the generation of equals and hashcode in models. If you set this to {@code false}, the models
178176 * will not have equals and hashcode.
179177 */
180- @ ConfigItem ( name = "equals-hashcode" )
181- public Optional <Boolean > equalsHashcode ;
178+ @ WithName ( "equals-hashcode" )
179+ Optional <Boolean > equalsHashcode () ;
182180}
0 commit comments