Questions tagged [pureconfig]
50 questions
1
vote
1 answer
Using pureconfig to read tuples encoded as a list or array
I'd like to use the PureConfig library to read a list of tuples. That is, I'd like to read
{
foo: [
[1, 1.0, "Good job!"]
[2, 2.0, "Excellent job!"]
[3, 0.0, "Please play again."]
]
}
as a
case class Wrapper(foo:Vector[(Int,…

bwbecker
- 1,031
- 9
- 21
1
vote
0 answers
Substituting key with environment variable in HOCON
I am using pureconfig to read config for my Scala application. The application.conf file is in HOCON format. My config file looks something like this
weathers {
${?HUMID_WEATHER_ID} {
temperature = 10
temperature =…

Ashwin
- 12,691
- 31
- 118
- 190
1
vote
0 answers
pureconfig is not parsing boolean value Scala CovertFailure(WrongType(String, Set(Boolean)))
In my app.config file there is a property like:
enable-toggle-prop {
update-toggle-enabled=false
}
The file where I am parsing looks like this:
import pureconfig._
import pureconfig.generic.auto._
case class MyConfig(updateToggleEnabled:…

Siddharth Shankar
- 489
- 1
- 10
- 21
1
vote
1 answer
Decode config to case class with pureconfig with default values
Assuming I have the following config:
{
“default-value”:5,
“some-seq”: [
{“some-other-value”:100},
{“foo”:”bar”},
{“some-other-value”:1500}
]
}
I want it to be decoded to case classes:
case class Config(defaultValue: Int, someSeq:…

D Artem
- 41
- 5
1
vote
0 answers
Pantsbuild: how to skip JVM class duplicates for a Scala library?
I'm using pants v1.30.0 and I need to find a workaround to build a Scala fat JAR that includes pureconfig v0.14.0.
Pantsbuild detect-duplicates:
Detect JVM classes and resources with the same qualified name on the classpath.
I'm experiencing the…

sentenza
- 1,608
- 3
- 29
- 51
1
vote
1 answer
Parsing an empty property into an empty Map with PureConfig
I have a case class like the following:
case class MyConfig(arg1:String, extraArgs:Map[String,String])
and I would like the following to be parsable from the HOCON config
{
arg1 = 'hello world'
}
However this fail because extraArgs is not…

Edmondo
- 19,559
- 13
- 62
- 115
1
vote
1 answer
force pureconfig to use -dconfig.file application.conf file and not resource application.conf
I have the following application.conf file:
# App
tables = [
"table_1",
"talbe_2"
]
and the following scala code:
import pureconfig._
import pureconfig.generic.auto._
import com.typesafe.config.ConfigFactory
import…

a.moussa
- 2,977
- 7
- 34
- 56
1
vote
1 answer
Loading Different files from resource directory via Pureconfig
I have few files in a resource folder and I have a mapping class for the same. Now All I want is to load each file in different config class using pureconfig. Is there any way to load it via providing only resource folder name.
- src
- main
…

Swaraj
- 589
- 4
- 15
1
vote
0 answers
PureConfig: Is it possible to add Documentation to the generated Configuration File
I am evaluating PureConfig to read and write Configuration files.
When writing the configuration file it look like:
# hardcoded value
"name" : "messageBundle",
# hardcoded value
"params" : { ...
Is it possible to have instead of # hardcoded value…

pme
- 14,156
- 3
- 52
- 95
1
vote
1 answer
How can I get PureConfig to deserialize JSON as a JValue field?
Part of my config contains arbitrary JSON. I want to deserialize that JSON as a JValue for later processing.
However, ConfigSource.load complains that the type key is not found.
Test code:
import org.json4s.JsonAST.JValue
import…

crenshaw-dev
- 7,504
- 3
- 45
- 81
1
vote
1 answer
Can pureconfig use camel case config
I'm using pureconfig pureconfig lib with pureconfig-yaml module. Everything works like a charm, my only problem is that I have to convert the property names from camel case to kebab case.
Painful examples from real world:
case class…

Tomas Bartalos
- 1,256
- 12
- 29
1
vote
1 answer
PureConfig ConfigLoader in Scala
I am following this link to use pureconfig to load the data
https://pureconfig.github.io/docs/overriding-behavior-for-case-classes.html.
Here is my code
import com.typesafe.config.ConfigFactory
import pureconfig._
private case class SampleConf(foo:…

Ayan Biswas
- 1,641
- 9
- 39
- 66
1
vote
1 answer
Can't get pureconfig to deserialize nested case classes
I'm trying to get nested case classes to deserialize with pureconfig, but the code fails to compile. I have something as follows:
import com.typesafe.config.{Config, ConfigFactory}
import pureconfig.error.ConfigReaderFailures
import…

user1178488
- 51
- 2
- 7
1
vote
0 answers
pureconfig Enumeratum nicer exceptions
How can I get nicer exceptions when using pureconfig with Enumeratum?
https://github.com/pureconfig/pureconfig/tree/master/modules/enumeratum
import pureconfig._
import pureconfig.generic.auto._
import pureconfig.module.enumeratum._
import…

Georg Heiler
- 16,916
- 36
- 162
- 292
1
vote
1 answer
What is the easiest way to use python to read pureconfig config files created in scala?
I have a scala config file created with the library pureconfig. I would like to write a wrapper in python to read and write this configfile (to give a better access to non scala users). Is the easiest way to parse the whole schema ?
My config file…

Mat Dout
- 11
- 1