diff --git a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java index 733147b79..2982e5662 100644 --- a/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java +++ b/client/deployment/src/main/java/io/quarkiverse/openapi/generator/deployment/codegen/OpenApiGeneratorCodeGenBase.java @@ -295,8 +295,7 @@ private static OpenApiClientGeneratorWrapper createGeneratorWrapper(Path openApi } private String getBasePackage(final Config config, final Path openApiFilePath) { - return config - .getOptionalValue(getSpecConfigName(BASE_PACKAGE, openApiFilePath), String.class) + return getValues(config, openApiFilePath, BASE_PACKAGE, String.class) .orElse(String.format("%s.%s", DEFAULT_PACKAGE, getSanitizedFileName(openApiFilePath))); } diff --git a/client/integration-tests/config-key/src/main/resources/application.properties b/client/integration-tests/config-key/src/main/resources/application.properties index da73f8891..de078f4ae 100644 --- a/client/integration-tests/config-key/src/main/resources/application.properties +++ b/client/integration-tests/config-key/src/main/resources/application.properties @@ -2,6 +2,7 @@ quarkus.rest-client.custom_config_key.url=http://localhost:8080 quarkus.openapi-generator.codegen.spec.config_key_openapi_yaml.config-key=custom_config_key quarkus.openapi-generator.codegen.spec.custom_config_key.mutiny=true +quarkus.openapi-generator.codegen.spec.custom_config_key.base-package=com.oapi.pkg # use the @AnotherCustomAnnotation with `config_key_openapi_yaml` quarkus.openapi-generator.codegen.spec.config_key_openapi_yaml.additional-api-type-annotations=@io.quarkiverse.openapi.generator.configkey.AnotherCustomAnnotation diff --git a/client/integration-tests/config-key/src/test/java/io/quarkiverse/openapi/generator/configkey/QuarkusConfigKeyOpenApiTest.java b/client/integration-tests/config-key/src/test/java/io/quarkiverse/openapi/generator/configkey/QuarkusConfigKeyOpenApiTest.java index eb525d122..82f2999db 100644 --- a/client/integration-tests/config-key/src/test/java/io/quarkiverse/openapi/generator/configkey/QuarkusConfigKeyOpenApiTest.java +++ b/client/integration-tests/config-key/src/test/java/io/quarkiverse/openapi/generator/configkey/QuarkusConfigKeyOpenApiTest.java @@ -8,9 +8,10 @@ import org.eclipse.microprofile.rest.client.inject.RestClient; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; -import org.openapi.quarkus.config_key_openapi_yaml.api.ReactiveGreetingResourceApi; import org.openapi.quarkus.empty_config_key_yaml.api.DefaultApi; +import com.oapi.pkg.api.ReactiveGreetingResourceApi; + import io.quarkus.test.junit.QuarkusTest; import io.smallrye.mutiny.Uni; @@ -40,6 +41,7 @@ void config_key_apiIsBeingGenerated() throws NoSuchMethodException { @Test void config_key_customAnnotation() { assertThat(ReactiveGreetingResourceApi.class.getAnnotation(CustomAnnotation.class)).isNotNull(); + assertThat(ReactiveGreetingResourceApi.class.getPackageName()).isEqualTo("com.oapi.pkg.api"); } @Test