We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When dealing with nested maps, Smallrye config is setting all keys as the key for the topmost map.
for an application.yml map:
key1: key2: key3: value
the config will read it as:
key3: key3: key3: value
When reading nested maps, the keys must match what is on the aplication.yml.
When reading nested maps, the keys are all set as the key of the topmost map.
package com.example; import io.smallrye.config.ConfigMapping; import java.util.Map; @ConfigMapping(prefix = "reproducer") public interface Config { Map<String, Map<String, Map<String, String>>> triple(); Map<String, Map<String, String>> dual(); }
package com.example; import io.quarkus.test.junit.QuarkusTest; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import javax.inject.Inject; import static org.junit.jupiter.api.Assertions.*; @QuarkusTest class ConfigTest { @Inject Config config; @Test void triple() { var key1 = config.triple().keySet().toArray()[0]; var key2 = config.triple().get(key1).keySet().toArray()[0]; var key3 = config.triple().get(key1).get(key2).keySet().toArray()[0]; var value = config.triple().get(key1).get(key2).get(key3); Assertions.assertAll( () -> assertEquals("key1", key1, "First map"), () -> assertEquals("key2", key2, "Second map"), () -> assertEquals("key3", key3, "Third map"), () -> assertEquals("value", value, "value") ); } @Test void dual() { var key1 = config.dual().keySet().toArray()[0]; var key2 = config.dual().get(key1).keySet().toArray()[0]; var value = config.dual().get(key1).get(key2); Assertions.assertAll( () -> assertEquals("key1", key1, "First map"), () -> assertEquals("key2", key2, "Second map"), () -> assertEquals("value", value, "value") ); } }
Application.yml
reproducer: dual: key1: key2: value triple: key1: key2: key3: value
uname -a
ver
Linux 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
java -version
openjdk version "11.0.15" 2022-04-19
No response
2.9.2.Final
mvnw --version
gradlew --version
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
This bug did not exist on version 2.5.x
The text was updated successfully, but these errors were encountered:
/cc @Ladicek, @jmartisk, @phillip-kruger, @radcortez
Sorry, something went wrong.
Duplicate of #26009.
radcortez
No branches or pull requests
Describe the bug
When dealing with nested maps, Smallrye config is setting all keys as the key for the topmost map.
for an application.yml map:
the config will read it as:
Expected behavior
When reading nested maps, the keys must match what is on the aplication.yml.
Actual behavior
When reading nested maps, the keys are all set as the key of the topmost map.
How to Reproduce?
Application.yml
Output of
uname -a
orver
Linux 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.15" 2022-04-19
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.9.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Additional information
This bug did not exist on version 2.5.x
The text was updated successfully, but these errors were encountered: