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

Support for HOCON (typesafe config) backend? #26

Open
Daenyth opened this issue Jun 24, 2019 · 3 comments
Open

Support for HOCON (typesafe config) backend? #26

Daenyth opened this issue Jun 24, 2019 · 3 comments

Comments

@Daenyth
Copy link

Daenyth commented Jun 24, 2019

I didn't see an example in the README - is this something that could be added, perhaps as a separate module?

@japgolly
Copy link
Owner

japgolly commented Jul 23, 2019 via email

@yadavan88
Copy link

yadavan88 commented Mar 2, 2022

@japgolly I came to know about this library and it is really awesome :) Thanks

Regarding the hocon format, if I currently have a config format as:

database {
  mongo {
   username = "mongoUser"
   password = "pass1"
  }
  postgres {
    username = "pgUser"
    password = "pass2"
  }
}

I should re-write them as and use .withPrefix("database.mongo.") and withPrefix("database.postgres.")

database.mongo.username = "mongoUser"
database.mongo.password = "pass1"
database.postgres.username = "pgUser"
database.postgres.password = "pass2"

Is this correct, or am I missing something?

@japgolly
Copy link
Owner

japgolly commented Mar 16, 2022

Hi @yadavan88 , currently we don't support reading from HOCON format.

If you mean you're moving away from HOCON, then yes that's the right way to do it. You could also have .withPrefix("mongo.") and .withPrefix("postgres.") and then after they're composed together, put a .withPrefix("database.") on the outside, but that depends on how you structure your config code. Whichever way works best for you is the one you should choose.

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

No branches or pull requests

3 participants