pureconfig | A boilerplate-free library for loading configuration files | Configuration Management library
kandi X-RAY | pureconfig Summary
kandi X-RAY | pureconfig Summary
PureConfig is a Scala library for loading configuration files. It reads Typesafe Config configurations written in HOCON, Java .properties, or JSON to native Scala classes in a boilerplate-free way. Sealed traits, case classes, collections, optional values, and many other types are all supported out-of-the-box. Users also have many ways to add support for custom types or customize existing ones.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pureconfig
pureconfig Key Features
pureconfig Examples and Code Snippets
Community Discussions
Trending Discussions on pureconfig
QUESTION
shapeless.DefaultSymbolicLabelling shapeless.DefaultSymbolicLabelling$.instance(shapeless.HList)
getting this error while using both pureconfig and circe.
I'm using spark 3.1.2 with spark k8s operator.
ANSWER
Answered 2022-Apr-15 at 07:17This error is because of conflicting shapeless library versions. Spark 3.1.2 ships with shapeless 2.3.3 whereas both these packages need shapeless 2.3.7. To solve this I followed the steps mentioned here which involve shading ie renaming the dependency.
For SBT
If you are using the sbt-assembly plugin to create your JARs you can shade shapeless by adding to your assembly.sbt file the following setting:
QUESTION
I'm trying to call PureConfig's loadOrThrow from method with generic type:
...ANSWER
Answered 2021-Dec-20 at 16:27To summarize comments and explain how this codec thing works.
When you do:
QUESTION
Is it possible to include in *conf file another conf file?
Current implementation:
...ANSWER
Answered 2021-Jul-16 at 16:17Pureconfig uses HOCON (though some of the interpretation of things like durations differ). HOCON include
is supported.
So assuming that you have model1.conf
in your resources (e.g. src/main/resources
), all you need in db-writer.conf
is
QUESTION
I have a ConfigLoader which I'm pretty sure works fine. I suspect I am not using application.conf file correctly or perhaps my directory containing the prd.env and dev.env is not in the correct place.
What I expect to happen:
I when I enter sbt run
the ConfigLoader reads the application.conf file, sees there are variables within that file. Then checks if prd.env or dev.env depending on which environment it is in and then finally loads the variables. I want this so I can have a different database for dev and prd.
- I have not idea how it would find the Meta directory which contains the prd.env and dev.env (see image).
- I have no idea how it would be able to tell whether if the environment is in dev or prd.
- The goal is to now look towards deploying this app, which is why I need these environment variables to work.
I really appreciate all the help but please try and detail your answers because I am really stuck and short answers often assume I know more than I do. Thanks :)
Tech stack incase relevant:
- HTTP4S,
- CATS,
- Doobie,
- PostgreSQL
application.conf file below:
...ANSWER
Answered 2021-Jan-16 at 16:34When running via sbt run
, the environment is set by the shell in which you're running sbt. Defining a dev.env
file by itself does nothing.
The mechanism for setting the environment in which sbt is running will vary depending on your shell.
For example if bash is your shell (this is worth trying in other Bourne-compatible shells), prefixing the environment variables with export
, e.g.:
QUESTION
I have a case class like the following:
...ANSWER
Answered 2021-Jan-12 at 15:49As @LuisMiguelMejíaSuárez suggested in the comment, you should add a default argument:
QUESTION
I have a simple config.json
file in my resources:
ANSWER
Answered 2020-Dec-02 at 15:14Your case classes don't match JSON. It should be something more like:
QUESTION
I have a new sbt application that I built using the akka http g8 template.
I am trying to add reactivemongo 1.0 to my build and I am getting this error:
...ANSWER
Answered 2020-Oct-30 at 03:04Can you try replacing "org.reactivemongo" %% "reactivemongo" % "1.0"
with "org.reactivemongo" %% "reactivemongo" % "1.0.0" % "provided"
?
I copy it from Maven Repository https://mvnrepository.com/artifact/org.reactivemongo/reactivemongo_2.13/1.0.0
QUESTION
Is it possible to make pureconfig read properties as Map[String, String]
? I have the following
application.conf
:
ANSWER
Answered 2020-Oct-16 at 22:04Your issue is not pureconfig. Your issue is that by HOCON spec what you wrote:
QUESTION
I have the following application.conf file:
...ANSWER
Answered 2020-Sep-29 at 21:03The problem is the call
QUESTION
I have following HOCON config:
...ANSWER
Answered 2020-Sep-20 at 14:05You can do the same without using recursion. Use method entrySet
as following
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pureconfig
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page