-
Notifications
You must be signed in to change notification settings - Fork 28
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
No support for having no prefix? #41
Comments
@golx There is no mode to disable inferred nesting, you can define a new source as a workaround. Here is an example: fun envSource(): Source {
return FlatSource(
System.getenv().filter { (key, _) ->
!(key.startsWith('.') || key.endsWith('.'))
}.toSortedMap(),
type = "system-environment",
allowConflict = true
)
}
Config {
addSpec(Root)
}
.from.yaml.resource("server.yml")
.withSource(envSource())
.from.systemProperties() |
@uchuhimo thanks! your workaround worked for me. In any case, this ticket can now be closed. |
I hit the same issue as well. In my case, it's a TOML configuration of the kind: [ arbitraryname1 ]
description = "..."
[ arbitraryname1.configuration ]
...
[ arbitraryname1.expectations ]
... there are several entries with arbitrary prefixes |
@DanySK Would you like to provide a minimal code snippet of your |
@golx I would like to add this feature to the next release. Thank you for your proposal! |
Thanks! We'll give it a try. |
Hello,
Say I have the following set of existing environment variables within my infrastructure:
I want to, without modifying them, be able to resolve these variables from both YAML file and environment variables, with latter having precedence.
It seems that such naming is discouraged by
konf
.I tried the following:
With YAML file having similar structure to the above:
Sadly, the moment
DATABASE_PASS
or similar variable appears in the env, I get the following exception:Is there a mode to rely on simple naming without inferred nesting?
The text was updated successfully, but these errors were encountered: