You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extension writing guide recommends using @ConfigMapping instead of @ConfigRoot with prefix and name but in case of split config with same prefix for build time and run time SR Config validation effectively forbids it.
Similar approach with @ConfigRoot(prefix = "my", name = "", phase = ...) seems to work fine.
Ability to map configuration properties to both run time and build time config with validation failure only if the property is absent in both.
Actual behavior
ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: io.smallrye.config.ConfigValidationException: Configuration validation failed:
my.greeting does not map to any root
How to Reproduce?
Reproducer:
quarkus create extension org.acme:my-ext && cd my-ext
The application.properties configuration is applied to both the build and runtime config. In this case, the configuration property my.greeting it not mapped in the build time config, which validates that all properties in the my namespace are mapped due to MyExtBuildTimeConfig.
Configuring the validation per namespace in SmallRye Config is possible, but unfortunately, we don't have a way to access the Config builder in build time Config. The only alternative is to either disable the validation completely with smallrye.config.mapping.validate-unknown=false or to use different namespaces between build and runtime.
In the meanwhile, I can add a way to access the Config builder.
Describe the bug
Extension writing guide recommends using
@ConfigMapping
instead of@ConfigRoot
with prefix and name but in case of split config with same prefix for build time and run time SR Config validation effectively forbids it.Similar approach with
@ConfigRoot(prefix = "my", name = "", phase = ...)
seems to work fine.See also: zulip thread.
Expected behavior
Ability to map configuration properties to both run time and build time config with validation failure only if the property is absent in both.
Actual behavior
How to Reproduce?
Reproducer:
quarkus create extension org.acme:my-ext && cd my-ext
runtime
module<module>intergration-tests</module>
to rootpom.xml
my.greeting = Hi
tointegration-tests/src/main/resources/application.properties
quarkus dev
Output of
uname -a
orver
Linux unterwelt 6.2.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 07 Apr 2023 02:10:43 +0000 x86_64 GNU/Linux
Output of
java -version
openjdk 17.0.6 2023-01-17 OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10) OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.16.6.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Additional information
No response
The text was updated successfully, but these errors were encountered: