diff --git a/client/deployment/pom.xml b/client/deployment/pom.xml index 68c37256..5fb3f85c 100644 --- a/client/deployment/pom.xml +++ b/client/deployment/pom.xml @@ -169,9 +169,6 @@ ${quarkus.version} - - -AlegacyConfigRoot=true - diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CodegenConfig.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CodegenConfig.java index 02192c6a..883a6cf9 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CodegenConfig.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CodegenConfig.java @@ -7,30 +7,32 @@ import java.util.stream.Collectors; import io.quarkiverse.openapi.generator.deployment.codegen.OpenApiGeneratorOutputPaths; -import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; +import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithName; import io.smallrye.config.common.utils.StringUtil; // This configuration is read in codegen phase (before build time), the annotation is for document purposes and avoiding quarkus warns -@ConfigRoot(name = CodegenConfig.CODEGEN_TIME_CONFIG_PREFIX, phase = ConfigPhase.BUILD_TIME) -public class CodegenConfig extends GlobalCodegenConfig { +@ConfigRoot(phase = ConfigPhase.BUILD_TIME) +@ConfigMapping(prefix = "quarkus." + CodegenConfig.CODEGEN_TIME_CONFIG_PREFIX) +public interface CodegenConfig extends GlobalCodegenConfig { - static final String CODEGEN_TIME_CONFIG_PREFIX = "openapi-generator.codegen"; + String CODEGEN_TIME_CONFIG_PREFIX = "openapi-generator.codegen"; - public static final String API_PKG_SUFFIX = ".api"; - public static final String MODEL_PKG_SUFFIX = ".model"; + String API_PKG_SUFFIX = ".api"; + String MODEL_PKG_SUFFIX = ".model"; - public static final String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_NAME_DEFAULT = "UNEXPECTED"; - public static final String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_STRING_VALUE_DEFAULT = "unexpected"; + String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_NAME_DEFAULT = "UNEXPECTED"; + String ADDITIONAL_ENUM_TYPE_UNEXPECTED_MEMBER_STRING_VALUE_DEFAULT = "unexpected"; // package visibility for unit tests - static final String BUILD_TIME_GLOBAL_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".%s"; - static final String BUILD_TIME_SPEC_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".spec.%s"; + String BUILD_TIME_GLOBAL_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".%s"; + String BUILD_TIME_SPEC_PREFIX_FORMAT = "quarkus." + CODEGEN_TIME_CONFIG_PREFIX + ".spec.%s"; - public static final List SUPPORTED_CONFIGURATIONS = Arrays.stream(ConfigName.values()).map(cn -> cn.name) + List SUPPORTED_CONFIGURATIONS = Arrays.stream(ConfigName.values()).map(cn -> cn.name) .collect(Collectors.toList()); - public enum ConfigName { + enum ConfigName { //global configs VERBOSE("verbose"), INPUT_BASE_DIR("input-base-dir"), @@ -88,28 +90,28 @@ public enum ConfigName { /** * OpenAPI Spec details for codegen configuration. */ - @ConfigItem(name = "spec") - public Map specItem; + @WithName("spec") + Map specItem(); - public static String resolveApiPackage(final String basePackage) { + static String resolveApiPackage(final String basePackage) { return String.format("%s%s", basePackage, API_PKG_SUFFIX); } - public static String resolveModelPackage(final String basePackage) { + static String resolveModelPackage(final String basePackage) { return String.format("%s%s", basePackage, MODEL_PKG_SUFFIX); } /** * Return global config name, openapi-generator.codegen.config-name */ - public static String getGlobalConfigName(ConfigName configName) { + static String getGlobalConfigName(ConfigName configName) { return String.format(BUILD_TIME_GLOBAL_PREFIX_FORMAT, configName.name); } /** * Return spec config name openapi-generator.codegen.spec.%s.config-name */ - public static String getSpecConfigName(ConfigName configName, final Path openApiFilePath) { + static String getSpecConfigName(ConfigName configName, final Path openApiFilePath) { return String.format("%s.%s", getBuildTimeSpecPropertyPrefix(openApiFilePath), configName.name); } @@ -119,7 +121,7 @@ public static String getSpecConfigName(ConfigName configName, final Path openApi * returned value is * openapi.generator.codegen.spec.petstore.mutiny. */ - public static String getSpecConfigNameByConfigKey(final String configKey, final ConfigName configName) { + static String getSpecConfigNameByConfigKey(final String configKey, final ConfigName configName) { String buildTimeSpecPropertyPrefix = String.format(BUILD_TIME_SPEC_PREFIX_FORMAT, configKey); return String.format("%s.%s", buildTimeSpecPropertyPrefix, configName.name); } @@ -130,11 +132,11 @@ public static String getSpecConfigNameByConfigKey(final String configKey, final * `quarkus.openapi-generator."petstore_json"`. * Every the periods (.) in the file name will be replaced by underscore (_). */ - public static String getBuildTimeSpecPropertyPrefix(final Path openApiFilePath) { + static String getBuildTimeSpecPropertyPrefix(final Path openApiFilePath) { return String.format(BUILD_TIME_SPEC_PREFIX_FORMAT, getSanitizedFileName(openApiFilePath)); } - public static String getSanitizedFileName(final Path openApiFilePath) { + static String getSanitizedFileName(final Path openApiFilePath) { return StringUtil .replaceNonAlphanumericByUnderscores(OpenApiGeneratorOutputPaths.getRelativePath(openApiFilePath).toString()); } diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java index 6d65cf4b..487403b5 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/CommonItemConfig.java @@ -3,8 +3,7 @@ import java.util.Map; import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; +import io.smallrye.config.WithName; /* * Model for the configuration of this extension. @@ -13,92 +12,91 @@ * Not meant to be used outside this scope. * Config items can be applied on spec and globally as well */ -@ConfigGroup -public class CommonItemConfig { +public interface CommonItemConfig { /** * Whether to skip the generation of models for form parameters */ - @ConfigItem(name = "skip-form-model") - public Optional skipFormModel; + @WithName("skip-form-model") + Optional skipFormModel(); /** * Type Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be used for a * given OAS datatype (the keys of this map) */ - @ConfigItem(name = "type-mappings") - public Map typeMappings; + @WithName("type-mappings") + Map typeMappings(); /** * Import Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be * imported when a given OAS datatype (the keys of this map) is used */ - @ConfigItem(name = "import-mappings") - public Map importMappings; + @WithName("import-mappings") + Map importMappings(); /** * Schema Mapping is an OpenAPI Generator configuration specifying which Java types (the values) should be * imported when a given schema type (the keys of this map) is used */ - @ConfigItem(name = "schema-mappings") - public Map schemaMappings; + @WithName("schema-mappings") + Map schemaMappings(); /** * The specified annotations will be added to the generated model files */ - @ConfigItem(name = "additional-model-type-annotations") - public Optional additionalModelTypeAnnotations; + @WithName("additional-model-type-annotations") + Optional additionalModelTypeAnnotations(); /** * Defines if the enums should have an `UNEXPECTED` member to convey values that cannot be parsed. Default is * {@code false}. */ - @ConfigItem(name = "additional-enum-type-unexpected-member") - public Optional additionalEnumTypeUnexpectedMemberAnnotations; + @WithName("additional-enum-type-unexpected-member") + Optional additionalEnumTypeUnexpectedMemberAnnotations(); /** * The specified annotations will be added to the generated api files */ - @ConfigItem(name = "additional-api-type-annotations") - public Optional additionalApiTypeAnnotations; + @WithName("additional-api-type-annotations") + Optional additionalApiTypeAnnotations(); /** * Add custom/additional HTTP Headers or other args to every request */ - @ConfigItem(name = "additional-request-args") - public Optional additionalRequestArgs; + @WithName("additional-request-args") + Optional additionalRequestArgs(); /** * Defines if the methods should return {@link jakarta.ws.rs.core.Response} or a model. Default is {@code false}. */ - @ConfigItem(name = "return-response") - public Optional returnResponse; + @WithName("return-response") + Optional returnResponse(); /** * Defines if security support classes should be generated */ - @ConfigItem(name = "enable-security-generation") - public Optional enableSecurityGeneration; + @WithName("enable-security-generation") + Optional enableSecurityGeneration(); /** * Defines the normalizer options. */ - @ConfigItem(name = "open-api-normalizer") - public Map normalizer; + @WithName("open-api-normalizer") + Map normalizer(); /** * Enable SmallRye Mutiny support. If you set this to {@code true}, all return types will be wrapped in * {@link io.smallrye.mutiny.Uni}. */ - @ConfigItem(name = "mutiny") - public Optional supportMutiny; + @WithName("mutiny") + Optional supportMutiny(); /** * Defines with SmallRye Mutiny enabled if methods should return {@link jakarta.ws.rs.core.Response} or a model. Default is * {@code false}. */ - @ConfigItem(name = "mutiny.return-response") - public Optional mutinyReturnResponse; + @WithName("mutiny.return-response") + Optional mutinyReturnResponse(); /** * Handles the return type for each operation, depending on the configuration. @@ -125,16 +123,16 @@ public class CommonItemConfig { * - If the operation has a void return type, it will return {@link io.smallrye.mutiny.Uni}. * - Otherwise, it will return {@link io.smallrye.mutiny.Uni}`. */ - @ConfigItem(name = "mutiny.operation-ids") - public Optional> mutinyMultiOperationIds; + @WithName("mutiny.operation-ids") + Map mutinyMultiOperationIds(); /** * Defines, whether the `PartFilename` ({@link org.jboss.resteasy.reactive.PartFilename} or * {@link org.jboss.resteasy.annotations.providers.multipart.PartFilename}) annotation should be generated for * MultipartForm POJOs. By setting to {@code false}, the annotation will not be generated. */ - @ConfigItem(name = "generate-part-filename") - public Optional generatePartFilename; + @WithName("generate-part-filename") + Optional generatePartFilename(); /** * Defines the filename for a part in case the `PartFilename` annotation @@ -143,40 +141,40 @@ public class CommonItemConfig { * In case no value is set, the default one is `<fieldName>File` or `file`, depending on the * {@link CommonItemConfig#useFieldNameInPartFilename} configuration. */ - @ConfigItem(name = "part-filename-value") - public Optional partFilenameValue; + @WithName("part-filename-value") + Optional partFilenameValue(); /** * Defines, whether the filename should also include the property name in case the `PartFilename` annotation * ({@link org.jboss.resteasy.reactive.PartFilename} or * {@link org.jboss.resteasy.annotations.providers.multipart.PartFilename}) is generated. */ - @ConfigItem(name = "use-field-name-in-part-filename") - public Optional useFieldNameInPartFilename; + @WithName("use-field-name-in-part-filename") + Optional useFieldNameInPartFilename(); /** * Enable bean validation. If you set this to {@code true}, validation annotations are added to generated sources E.g. * {@code @Size}. */ - @ConfigItem(name = "use-bean-validation") - public Optional useBeanValidation; + @WithName("use-bean-validation") + Optional useBeanValidation(); /** * Enable the generation of APIs. If you set this to {@code false}, APIs will not be generated. */ - @ConfigItem(name = "generate-apis") - public Optional generateApis; + @WithName("generate-apis") + Optional generateApis(); /** * Enable the generation of models. If you set this to {@code false}, models will not be generated. */ - @ConfigItem(name = "generate-models") - public Optional generateModels; + @WithName("generate-models") + Optional generateModels(); /** * Enable the generation of equals and hashcode in models. If you set this to {@code false}, the models * will not have equals and hashcode. */ - @ConfigItem(name = "equals-hashcode") - public Optional equalsHashcode; + @WithName("equals-hashcode") + Optional equalsHashcode(); } diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/GlobalCodegenConfig.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/GlobalCodegenConfig.java index aff927be..0c9f5888 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/GlobalCodegenConfig.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/GlobalCodegenConfig.java @@ -2,8 +2,8 @@ import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; +import io.smallrye.config.WithDefault; +import io.smallrye.config.WithName; /* * Model for the configuration of this extension. @@ -12,50 +12,51 @@ * Not meant to be used outside this scope. * Config items can be applied only globally */ -@ConfigGroup -public class GlobalCodegenConfig extends CommonItemConfig { +public interface GlobalCodegenConfig extends CommonItemConfig { /** * Whether to log the internal generator codegen process in the default output or not. */ - @ConfigItem(name = "verbose", defaultValue = "false") - public boolean verbose; + @WithDefault("false") + @WithName("verbose") + boolean verbose(); /** * Option to change the directory where OpenAPI files must be found. */ - @ConfigItem(name = "input-base-dir") - public Optional inputBaseDir; + @WithName("input-base-dir") + Optional inputBaseDir(); /** * Option to change the directory where template files must be found. */ - @ConfigItem(name = "template-base-dir") - public Optional templateBaseDir; + @WithName("template-base-dir") + Optional templateBaseDir(); /** * Whether or not to skip validating the input spec prior to generation. By default, invalid specifications will result in * an error. */ - @ConfigItem(name = "validateSpec", defaultValue = "true") - public boolean validateSpec; + @WithName("validateSpec") + @WithDefault("true") + boolean validateSpec(); /** * Option to specify files for which generation should be executed only */ - @ConfigItem(name = "include") - public Optional include; + @WithName("include") + Optional include(); /** * Option to exclude file from generation */ - @ConfigItem(name = "exclude") - public Optional exclude; + @WithName("exclude") + Optional exclude(); /** * Create security for the referenced security scheme */ - @ConfigItem(name = "default-security-scheme") - public Optional defaultSecuritySchema; + @WithName("default-security-scheme") + Optional defaultSecuritySchema(); } diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java index 3eb45978..bffb801f 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/SpecItemConfig.java @@ -2,8 +2,7 @@ import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; +import io.smallrye.config.WithName; /* * Model for the configuration of this extension. @@ -12,48 +11,48 @@ * Not meant to be used outside this scope. * Config items can be applied only on spec */ -@ConfigGroup -public class SpecItemConfig extends CommonItemConfig { +public interface SpecItemConfig extends CommonItemConfig { /** * Base package for where the generated code for the given OpenAPI specification will be added. */ - @ConfigItem(name = "base-package") - public Optional basePackage; + @WithName("base-package") + Optional basePackage(); /** * Suffix name for generated api classes */ - @ConfigItem(name = "api-name-suffix") - public Optional apiNameSuffix; + @WithName("api-name-suffix") + Optional apiNameSuffix(); /** * Suffix name for generated model classes */ - @ConfigItem(name = "model-name-suffix") - public Optional modelNameSuffix; + @WithName("model-name-suffix") + Optional modelNameSuffix(); /** * Prefix name for generated model classes */ - @ConfigItem(name = "model-name-prefix") - public Optional modelNamePrefix; + @WithName("model-name-prefix") + Optional modelNamePrefix(); /** * Remove operation id prefix */ - @ConfigItem(name = "remove-operation-id-prefix") - public Optional removeOperationIdPrefix; + + @WithName("remove-operation-id-prefix") + Optional removeOperationIdPrefix(); /** * Remove operation id prefix */ - @ConfigItem(name = "remove-operation-id-prefix-delimiter") - public Optional removeOperationIdPrefixDelimiter; + @WithName("remove-operation-id-prefix-delimiter") + Optional removeOperationIdPrefixDelimiter(); /** * Remove operation id prefix */ - @ConfigItem(name = "remove-operation-id-prefix-count") - public Optional removeOperationIdPrefixCount; + @WithName("remove-operation-id-prefix-count") + Optional removeOperationIdPrefixCount(); } diff --git a/client/runtime/pom.xml b/client/runtime/pom.xml index d50c39f2..e5ec29b6 100644 --- a/client/runtime/pom.xml +++ b/client/runtime/pom.xml @@ -94,9 +94,6 @@ ${quarkus.version} - - -AlegacyConfigRoot=true - diff --git a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthsConfig.java b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthsConfig.java index a02f00c1..ce90f077 100644 --- a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthsConfig.java +++ b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/AuthsConfig.java @@ -3,11 +3,9 @@ import java.util.Map; import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; +import io.smallrye.config.WithParentName; -@ConfigGroup -public class AuthsConfig { +public interface AuthsConfig { /** * Configurations for the individual securitySchemes present on a given OpenApi spec definition file. @@ -21,17 +19,10 @@ public class AuthsConfig { * @see SpecItemConfig * @see AuthConfig */ - @ConfigItem(name = ConfigItem.PARENT) - public Map authConfigs; + @WithParentName() + Map authConfigs(); - public Optional getItemConfig(String authConfig) { - return Optional.ofNullable(authConfigs.get(authConfig)); - } - - @Override - public String toString() { - return "AuthsConfig{" + - "authConfigs=" + authConfigs + - '}'; + default Optional getItemConfig(String authConfig) { + return Optional.ofNullable(authConfigs().get(authConfig)); } } diff --git a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/OpenApiGeneratorConfig.java b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/OpenApiGeneratorConfig.java index 6b297f57..9fe301a9 100644 --- a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/OpenApiGeneratorConfig.java +++ b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/OpenApiGeneratorConfig.java @@ -3,18 +3,20 @@ import java.util.Map; import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; +import io.smallrye.config.ConfigMapping; +import io.smallrye.config.WithParentName; import io.smallrye.config.common.utils.StringUtil; /** * This class represents the runtime configurations for the openapi-generator extension. */ -@ConfigRoot(name = OpenApiGeneratorConfig.RUNTIME_TIME_CONFIG_PREFIX, phase = ConfigPhase.RUN_TIME) -public class OpenApiGeneratorConfig { +@ConfigMapping(prefix = "quarkus." + OpenApiGeneratorConfig.RUNTIME_TIME_CONFIG_PREFIX) +@ConfigRoot(phase = ConfigPhase.RUN_TIME) +public interface OpenApiGeneratorConfig { - public static final String RUNTIME_TIME_CONFIG_PREFIX = "openapi-generator"; + String RUNTIME_TIME_CONFIG_PREFIX = "openapi-generator"; /** * Configurations of the individual OpenApi spec definitions, i.e. the provided files. @@ -23,21 +25,14 @@ public class OpenApiGeneratorConfig { * For example, a file named petstore.json is sanitized into the name petstore_json, and thus the specific * configurations this file must start with the prefix quarkus.openapi-generator.petstore_json */ - @ConfigItem(name = ConfigItem.PARENT) - public Map itemConfigs; + @WithParentName + Map itemConfigs(); - public Optional getItemConfig(String specItem) { - return Optional.ofNullable(itemConfigs.get(specItem)); + default Optional getItemConfig(String specItem) { + return Optional.ofNullable(itemConfigs().get(specItem)); } - @Override - public String toString() { - return "OpenApiGeneratorConfig{" + - "itemConfigs=" + itemConfigs + - '}'; - } - - public static String getSanitizedSecuritySchemeName(final String securitySchemeName) { + static String getSanitizedSecuritySchemeName(final String securitySchemeName) { return StringUtil.replaceNonAlphanumericByUnderscores(securitySchemeName); } } diff --git a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/SpecItemConfig.java b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/SpecItemConfig.java index 91c79b65..da942e1f 100644 --- a/client/runtime/src/main/java/io/quarkiverse/openapi/generator/SpecItemConfig.java +++ b/client/runtime/src/main/java/io/quarkiverse/openapi/generator/SpecItemConfig.java @@ -2,15 +2,11 @@ import java.util.Optional; -import io.quarkus.runtime.annotations.ConfigGroup; -import io.quarkus.runtime.annotations.ConfigItem; - /** * This class represents the runtime authentication related configurations for the individual OpenApi spec definitions, * i.e. the provided files. */ -@ConfigGroup -public class SpecItemConfig { +public interface SpecItemConfig { /** * Authentication related configurations for the different securitySchemes present on a given OpenApi spec @@ -21,17 +17,9 @@ public class SpecItemConfig { * * @see AuthsConfig */ - @ConfigItem - public AuthsConfig auth; - - public Optional getAuth() { - return Optional.ofNullable(auth); - } + AuthsConfig auth(); - @Override - public String toString() { - return "SpecItemConfig{" + - "auth=" + auth + - '}'; + default Optional getAuth() { + return Optional.ofNullable(auth()); } -} \ No newline at end of file +} diff --git a/server/deployment/pom.xml b/server/deployment/pom.xml index 7c961912..2358b448 100755 --- a/server/deployment/pom.xml +++ b/server/deployment/pom.xml @@ -38,9 +38,6 @@ ${quarkus.version} - - -AlegacyConfigRoot=true - diff --git a/server/deployment/src/main/java/io/quarkiverse/openapi/server/generator/deployment/CodegenConfig.java b/server/deployment/src/main/java/io/quarkiverse/openapi/server/generator/deployment/CodegenConfig.java index 139c2c1f..19f5d9a5 100755 --- a/server/deployment/src/main/java/io/quarkiverse/openapi/server/generator/deployment/CodegenConfig.java +++ b/server/deployment/src/main/java/io/quarkiverse/openapi/server/generator/deployment/CodegenConfig.java @@ -2,29 +2,31 @@ import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; +import io.smallrye.config.ConfigMapping; -@ConfigRoot(name = CodegenConfig.CODEGEN_TIME_CONFIG_PREFIX, phase = ConfigPhase.BUILD_TIME) -public class CodegenConfig { +@ConfigRoot(phase = ConfigPhase.BUILD_TIME) +@ConfigMapping(prefix = CodegenConfig.CODEGEN_TIME_CONFIG_PREFIX) +public interface CodegenConfig { - static final String CODEGEN_TIME_CONFIG_PREFIX = "quarkus.openapi.generator"; - private static final String CODEGEN_BASE_PACKAGE = CODEGEN_TIME_CONFIG_PREFIX + ".base-package"; - private static final String CODEGEN_SPEC = CODEGEN_TIME_CONFIG_PREFIX + ".spec"; - private static final String INPUT_BASE_DIR = CODEGEN_TIME_CONFIG_PREFIX + ".input-base-dir"; - private static final String CODEGEN_REACTIVE = CODEGEN_TIME_CONFIG_PREFIX + ".reactive"; + String CODEGEN_TIME_CONFIG_PREFIX = "quarkus.openapi.generator"; + String CODEGEN_BASE_PACKAGE = CODEGEN_TIME_CONFIG_PREFIX + ".base-package"; + String CODEGEN_SPEC = CODEGEN_TIME_CONFIG_PREFIX + ".spec"; + String INPUT_BASE_DIR = CODEGEN_TIME_CONFIG_PREFIX + ".input-base-dir"; + String CODEGEN_REACTIVE = CODEGEN_TIME_CONFIG_PREFIX + ".reactive"; - public static String getBasePackagePropertyName() { + static String getBasePackagePropertyName() { return CODEGEN_BASE_PACKAGE; } - public static String getSpecPropertyName() { + static String getSpecPropertyName() { return CODEGEN_SPEC; } - public static String getInputBaseDirPropertyName() { + static String getInputBaseDirPropertyName() { return INPUT_BASE_DIR; } - public static String getCodegenReactive() { + static String getCodegenReactive() { return CODEGEN_REACTIVE; } }