Questions tagged [pureconfig]

Github repository

50 questions
1
vote
0 answers

Typesafe config: write / create reference

What I want to do is quite straight forward. I want to create a config object in my code and some of the values should be references. I then want to save that config to a file and later, when reading it, the references will be substituted with the…
simon
  • 53
  • 10
1
vote
0 answers

Custom Types using pureconfig?

I am using PureConfig with Refined. I have the following case class: case class Config(port: ServerPort, interface: String) ServerPort is a custom type that I have defined using Refined. I am using pureconfig to load a conf file into the Config…
Nespony
  • 1,253
  • 4
  • 24
  • 42
1
vote
0 answers

force pureconfig to generate ConfigReader for case classes

I have a implicit class that wraps around a typesafe Config class to parse information from it. This class uses pureconfig to parse the data out. I use this because I prefer config.as[String]("foo") instead of loadConfig[String](config, "foo"). But…
rogue-one
  • 11,259
  • 7
  • 53
  • 75
1
vote
2 answers

assign any val scala pureconfig during configuration read

I know this is going against the very nature of Scala pureconfig ... however ... Is it even feasible to implement with scala pureconfig configuration reading for this case class, so that instead of having strongly typed value( as String) for the…
Yordan Georgiev
  • 5,114
  • 1
  • 56
  • 53
1
vote
1 answer

How to hide configuration management from the main function?

I have my entry point like this: def main(args: Array[String]): Unit = { pureconfig.loadConfig[Conf] match { case Right(conf) => doStuff(conf) case Left(fail) => lectureUserAboutStuff(fail) } } So it looks like the main purpose of my…
gurghet
  • 7,591
  • 4
  • 36
  • 63
0
votes
2 answers

explicit types for implicit pureconfig ConfigReaders

Scala v2.13.11 issues a warning for the following code from the pureconfig orElse documentation (bottom of the page): val csvIntListReader = ConfigReader[String].map(_.split(",").map(_.toInt).toList) implicit val intListReader =…
bwbecker
  • 1,031
  • 9
  • 21
0
votes
1 answer

Why is Either expected in the following for comprehension?

I am playing with tagless final in scala. I use pureconfig to load the configuration and then use the configuration values to set the server port and host. Snippet def create[F[_]: Async] = for { config <-…
nashter
  • 1,181
  • 1
  • 15
  • 33
0
votes
1 answer

Implementing Config class containing Enum Map by PureConfig and Enumeratum

I'm trying to read my config file into my case class whose one of attribute is a Map of Enumeratum key and Case Class value by using pureconfig and pureconfig-enumeratum libraries version 0.14.0 with scala 2.11. When I change the Map key from…
gabby
  • 629
  • 2
  • 11
  • 34
0
votes
1 answer

Shapeless error while trying trying to use PureConfig and Circe for scala

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.
Pradyumna
  • 195
  • 3
  • 11
0
votes
1 answer

Using generic type with PureConfig in Scala

I'm trying to call PureConfig's loadOrThrow from method with generic type: def load[T: ClassTag](path: String): T = { import pureconfig.generic.auto._ ConfigSource.file(path).loadOrThrow[T] } When I try to call it from main class, i got…
Niccko
  • 7
  • 1
  • 1
0
votes
1 answer

Pureconfig - is it possible to include in conf file another conf file?

Is it possible to include in *conf file another conf file? Current implementation: // db-writer.conf writer: { name="DatabaseWriter", model="model1", table-name="model1", append=false, create-table-file="sql/create_table_model1.sql", …
Pipa
  • 37
  • 7
0
votes
2 answers

Scala: How to load environment variables into Application.conf using scala?

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…
Ry2254
  • 859
  • 1
  • 10
  • 19
0
votes
0 answers

How to load a hocon config into a case class dynamically at run time

I am working on a library that will take a user config hocon and user provide case class(in the classpath of the user application), I need to read the hocon config to the case class dynamically at runtime.. Dynamically I mean here that I would not…
Praneeth Ramesh
  • 3,434
  • 1
  • 28
  • 34
0
votes
3 answers

Read Hocon config as a Map[String, String] with key in dot notation and value

I have following HOCON config: a { b.c.d = "val1" d.f.g = "val2" } HOCON represents paths "b.c.d" and "d.f.g" as objects. So, I would like to have a reader, which reads these configs as Map[String, String], ex: Map("b.c.d" -> "val1", "d.f.g" ->…
user23
  • 21
  • 6
0
votes
1 answer

Apache Flink and Pureconfig - passing java properties on job startup

I would want to use pureconfig with apache Flink. How can I pass additional java properties when starting the job? I try to pass it via: -yD env.java.opts="-Dconfig.file='config/jobs/twitter-analysis.conf'" argument, but it is not…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292