Bug: ConfigProperty annotation on Map<String, String> field doesn't filter the configuration values, but populates all configuration entries in Map
See original GitHub issueFor a map configuration field like below, i expect the map to be populated with all configuration entries under configKey section, but the map is populated with all possible configuration entries - without any filtering.
@Inject
@ConfigProperty(name = "configKey")
Map<String, String> configKeyMap;
Is this behaviour expected??? Is there a provision to filter out the configuration entries that just match to the name mentioned in the annotation?
If i understand correctly, filtration happens properly for List and Set field types (at-least as per the code for those branches). Why the behaviour is different for Map alone???
Environment Details
- Helidon Version: 2.5.1
- Helidon MP
- JDK version: JDK 17
- OS: Windows 11
- Docker version (if applicable): NA
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Bug: ConfigProperty annotation on Map<String, String> field doesn't ...
Bug: ConfigProperty annotation on Map<String, String> field doesn't filter the configuration values, but populates all configuration entries in Map #4414.
Read more >How to bind properties into a Map in Quarkus - Jose Carvajal
In Quarkus, the config values are injected via the @ConfigProperty annotation. But there is another annotation called @ConfigMapping to map more complex ...
Read more >Configuration Reference Guide - Quarkus
In this reference guide we're going to describe various aspects of Quarkus configuration. A Quarkus application and Quarkus itself (core and extensions) are...
Read more >Core Features - Spring
The properties that map to @ConfigurationProperties classes available in Spring Boot, which are configured through properties files, YAML files, ...
Read more >Eager Initialization of Singletons - Micronaut Documentation
2, The @Get annotation is used to map the index method to all requests ... be populated with configuration values, the @ConfigurationBuilder annotation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As this is not tested, we did not catch the difference in behavior. This was quite a big change (we had to switch away from using Helidon SE Config to using a full implementation of MP Config due to differences in handling environment variables), I have missed it when implementing it. We will get back to this and restore the original behavior
In the PR:
@ConfigProperty
will inject only properties prefixed by that key, with the key removed from keys of the map