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
I have the following configuration : --- app-config.yml -
reksio: awake: true bornIn : Kolkata birthYear : 1987 friends : - Kulbeer - Anil - Tapas homepage : https://en.wikipedia.org/wiki/Arka_Dutta/ points: Math : 92 PE : 99 Bengali : 90
My Config file code --
public interface ReksioConfig { Boolean awake(); String bornIn(); Integer birthYear(); List<String> friends(); String homepage(); Map<String, Integer> points(); }
Now when I do the following - ReksioConfig reksioConfig = configurationProvider.bind("reksio", ReksioConfig.class); -- in the main class -
ReksioConfig reksioConfig = configurationProvider.bind("reksio", ReksioConfig.class);
It throws this exception --- java.util.NoSuchElementException: No configuration with key: reksio.points
I debugged your code to find out the issue -- org.cfg4j.source.context.propertiesprovider.YamlBasedPropertiesProvider#getProperties
line 55 - 56
Map<String, Object> yamlAsMap = convertToMap(object); properties.putAll(flatten(yamlAsMap));
org.cfg4j.source.context.propertiesprovider.FormatBasedPropertiesProvider#flatten
if (value instanceof Map) { Map<String, Object> subMap = flatten((Map<String, Object>) value); for (String subkey : subMap.keySet()) { result.put(key + "." + subkey, subMap.get(subkey)); } }
This is the issue you faltten it out --
org.cfg4j.provider.SimpleConfigurationProvider#getProperty(java.lang.String) are these lines --
Object property = configurationSource.getConfiguration(environment).get(key); if (property == null) { throw new NoSuchElementException("No configuration with key: " + key); }
Point is how to do I acheive Map<K,V> map -- inside my config where map is the class variable as itself is not a class/interface--
Kindly help I really want to use cfg4j it does a lot of task which we have to build otherwise. But map is a real requirement
The text was updated successfully, but these errors were encountered:
I have the following configuration : --- app-config.yml - reksio: awake: true bornIn : Kolkata birthYear : 1987 friends : - Kulbeer - Anil - Tapas homepage : https://en.wikipedia.org/wiki/Arka_Dutta/ points: Math : 92 PE : 99 Bengali : 90 My Config file code -- public interface ReksioConfig { Boolean awake(); String bornIn(); Integer birthYear(); List<String> friends(); String homepage(); Map<String, Integer> points(); } Now when I do the following - ReksioConfig reksioConfig = configurationProvider.bind("reksio", ReksioConfig.class); -- in the main class - It throws this exception --- java.util.NoSuchElementException: No configuration with key: reksio.points I debugged your code to find out the issue -- org.cfg4j.source.context.propertiesprovider.YamlBasedPropertiesProvider#getProperties line 55 - 56 Map<String, Object> yamlAsMap = convertToMap(object); properties.putAll(flatten(yamlAsMap)); org.cfg4j.source.context.propertiesprovider.FormatBasedPropertiesProvider#flatten if (value instanceof Map) { Map<String, Object> subMap = flatten((Map<String, Object>) value); for (String subkey : subMap.keySet()) { result.put(key + "." + subkey, subMap.get(subkey)); } } This is the issue you faltten it out -- org.cfg4j.provider.SimpleConfigurationProvider#getProperty(java.lang.String) are these lines -- Object property = configurationSource.getConfiguration(environment).get(key); if (property == null) { throw new NoSuchElementException("No configuration with key: " + key); } Point is how to do I acheive Map<K,V> map -- inside my config where map is the class variable as itself is not a class/interface-- Kindly help I really want to use cfg4j it does a lot of task which we have to build otherwise. But map is a real requirement
Can confirm that this is a bug. It works if you do
points: Math=92,PE=99,Bengali=90
, but that does not make sense to do in a yaml file.
Sorry, something went wrong.
No branches or pull requests
I have the following configuration : ---
app-config.yml -
My Config file code --
Now when I do the following -
ReksioConfig reksioConfig = configurationProvider.bind("reksio", ReksioConfig.class);
--in the main class -
It throws this exception ---
java.util.NoSuchElementException: No configuration with key: reksio.points
I debugged your code to find out the issue --
org.cfg4j.source.context.propertiesprovider.YamlBasedPropertiesProvider#getProperties
line 55 - 56
org.cfg4j.source.context.propertiesprovider.FormatBasedPropertiesProvider#flatten
This is the issue you faltten it out --
org.cfg4j.provider.SimpleConfigurationProvider#getProperty(java.lang.String)
are these lines --
Point is how to do I acheive Map<K,V> map -- inside my config where map is the class variable as itself is not a class/interface--
Kindly help I really want to use cfg4j it does a lot of task which we have to build otherwise. But map is a real requirement
The text was updated successfully, but these errors were encountered: