Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ConfigMapping with Optional values does not load values when inheriting interface #37577

Closed
fire2 opened this issue Dec 7, 2023 · 0 comments · Fixed by #37794
Closed

@ConfigMapping with Optional values does not load values when inheriting interface #37577

fire2 opened this issue Dec 7, 2023 · 0 comments · Fixed by #37794
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@fire2
Copy link

fire2 commented Dec 7, 2023

Describe the bug

  1. Consider a configuration interface annotated with @ConfigMapping that inherits from another interface, such as https://github.com/fire2/quarkus-bug-configmapping/blob/main/src/main/java/org/config/Configuration.java. Define the config properties as Optional: https://github.com/fire2/quarkus-bug-configmapping/blob/main/src/main/java/org/config/MarketConfig.java
  2. Provide proper values for the config in application.yaml: https://github.com/fire2/quarkus-bug-configmapping/blob/main/src/main/resources/application.yaml

The config values do not load, all the Optionals are empty, although there are valid values in application.yaml.

Expected behavior

The config values are loaded correctly and the optionals are not empty. This works fine when they are defined directly in the annotated interface. It also worked fine in Quarkus 2.15.3.Final.

Actual behavior

Optionals are empty.

How to Reproduce?

  1. Clone https://github.com/fire2/quarkus-bug-configmapping/tree/main
  2. Run https://github.com/fire2/quarkus-bug-configmapping/blob/main/src/test/java/org/config/ConfigurationTest.java

Output of uname -a or ver

Darwin LMUCM902989 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:27 PDT 2023; root:xnu-10002.41.9~6/RELEASE_X86_64 x86_64 i386 Darwin

Output of java -version

openjdk 17.0.7 2023-04-18 LTS OpenJDK Runtime Environment Zulu17.42+19-CA (build 17.0.7+7-LTS) OpenJDK 64-Bit Server VM Zulu17.42+19-CA (build 17.0.7+7-LTS, mixed mode, sharing)

Quarkus version or git rev

3.6.0

Build tool (ie. output of mvnw --version or gradlew --version)

mvn

Additional information

No response

@fire2 fire2 added the kind/bug Something isn't working label Dec 7, 2023
@fire2 fire2 changed the title @ConfigMapping with Optional values does not load values @ConfigMapping with Optional values does not load values when inheriting interface Dec 7, 2023
@radcortez radcortez self-assigned this Dec 7, 2023
@quarkus-bot quarkus-bot bot added this to the 3.7 - main milestone Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants