-
Notifications
You must be signed in to change notification settings - Fork 566
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
Hocon config map parsing issue #4398
Comments
@aljawado700, ignoring
rather than
to be able to extract this child key names:
|
I think the problem if we don't include the full path in the key, say if we use below statement
is that, it will conflict with another property using the same name if for example we have this config:
right? |
But we can extract them separately if we retrieve themfrom the actual parent node rather than the root node, like this:
and this:
|
You are correct and I am able to get the the properties map fine. The issue I guess is the ~1. |
Keys will be unescaped when the map is returned via:
|
Environment Details
Problem Description
When using hocon configs, helidon config parser maps full path to the keys and replaces dots with "~1"
Steps to reproduce
define a hocon config file test.conf with the following content:
ServiceConfig {
someConfig {
properties: {
"retries": 1
"request.timeout.ms": 10000
"delivery.timeout.ms": 30000
"buffer.memory": 335544320
"max.block.ms": 500
"max.request.size": 10485760
}
}
}
read the content using helidon config:
public static void main(String[] args) {
Config config = Config.builder()
.addSource(ConfigSources.file("./test.conf"))
.build();
Map<String, String> cfg = config.get("serviceConfig").detach().asMap().get();
cfg.forEach((key, value) -> System.out.println(key + ":" + value));
}
output:
someConfig.properties.max
1block1ms:500someConfig.properties.buffer
1memory:3355443201timeoutsomeConfig.properties.delivery
1ms:300001timeoutsomeConfig.properties.retries:1
someConfig.properties.request
1ms:100001request~1size:10485760someConfig.properties.max
as you can see above, the last dot is replaced with ~1 and the key has the full path. The output we were expecting, however, is:
request.timeout.ms: 10000
delivery.timeout.ms: 30000
buffer.memory: 335544320
max.block.ms: 500
max.request.size: 10485760
The text was updated successfully, but these errors were encountered: