Skip to content
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

Allow substitutions in keys #532

Open
danielyli opened this issue Dec 4, 2017 · 1 comment
Open

Allow substitutions in keys #532

danielyli opened this issue Dec 4, 2017 · 1 comment

Comments

@danielyli
Copy link

Lightbend’s Cinnamon configuration for Akka HTTP uses user-configurable key names that need to match values in other parts of the configuration. It would be very helpful to support the following syntax:

app {
  http {
    host = "localhost"
    port = 8000
  }
}

cinnamon.akka.http.servers {
  ${app.http.host}.${app.http.port} {
    // etc...
  }
}
@havocp
Copy link
Collaborator

havocp commented Dec 5, 2017

Somewhat related are #122 and #134 ... I felt like there might be an issue for this already but maybe i was thinking of those two slightly different ideas.

This is maybe trickier to specify than it might seem at first, in particular the interaction with merging (represented in code by the withFallback operation) is not immediately clear to me. Once specified it could also be tricky to implement - there's more to the substitution algorithm than one might expect. See https://github.com/lightbend/config/blob/master/HOCON.md#substitutions for the prose version or the code for the code version...

Just speculation though; it's possible that the existing rules for unresolved values could simply work for this case also (an object is unresolved if it contains anything unresolved, etc), if so maybe it doesn't add much more difficulty to do this. Needs exploration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants