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

Absence of defined variables overrides defined variables? #56

Closed
peterfigure opened this issue May 19, 2020 · 2 comments
Closed

Absence of defined variables overrides defined variables? #56

peterfigure opened this issue May 19, 2020 · 2 comments
Labels

Comments

@peterfigure
Copy link

Hi - trying out Konf and seeing this behaviour:

object ServicingConfig : ConfigSpec("servicing") {
    val baseURL by required<String>("baseURL")
}
val config = Config {
     addSpec(ServicingConfig)
}.withSource(
     Source.from.hocon.resource("application.conf") +
        Source.from.env()
)

with application.conf:

servicing {
  baseURL = "https://service/api"
}

the result is that config is empty. However, if I remove Source.from.env() it works as expected. My expectation was that I can override variables set in the hocon config with environmental variables (on a per environment basis for example), the absence of an environmental variable won't displace the defined variable in HOCON. Is that an unrealistic expectation?

@stale
Copy link

stale bot commented Aug 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.

@stale stale bot added the stale label Aug 18, 2020
@uchuhimo uchuhimo added 0.23.0 and removed stale labels Oct 8, 2020
@uchuhimo
Copy link
Owner

@peterfigure I have released a new version v0.23.0 that fixes this bug. You can try it now. Any further feedback is welcome.

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

No branches or pull requests

2 participants