Skip to content

Instantly share code, notes, and snippets.

@terjokhin
Last active December 28, 2018 12:42
Show Gist options
  • Save terjokhin/3133a7828dafd45b823ab33daef469b5 to your computer and use it in GitHub Desktop.
Save terjokhin/3133a7828dafd45b823ab33daef469b5 to your computer and use it in GitHub Desktop.
case class Data(v: String, k: String)
case class DataMap(map: Map[String, Data])
val cfg = """
|example {
| map {
| "1" : {
| v: "v"
| k: "k"
| }
| "2" : {
| v: "v1"
| k: "k1"
| }
| }
| keyPrefixLength : 12
|}
""".stripMargin
import pureconfig._
import pureconfig.generic.auto._
val myConfig = ConfigFactory.parseString(cfg)
val read = loadConfig[DataMap](myConfig, "example")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment