I'm trying to load up a Map[String, Any] from the config file. It's currently written like this
map-name {
stringValue = "firstValue"
intValue = 1
booleanValue = true
}
Pureconfig is having trouble reading this config as a Map[String, Any]. It only works if replace Any with some strict type but I want more flexibility than this.
Is there any way around this?
Yes there is. You can use this type:
Map[String, ConfigValue]ConfigValuefrom its Scala Doc:But then you can use
ConfigObjectinstead ofMap[String, ConfigValue], as this is the same thing.You can handle this now like a
JSON-Objectstructure.Here are some examples: java-api-usage-examples.