1

I have the following Case Class:

case class MyClass(name: String, params: Map[String, String])

I couldn't figure out how to create a Config Description for this. Also automatic derivation with Magnolia did not work.

Error:(70, 44) could not find implicit value for evidence parameter of type zio.config.magnolia.ConfigDescriptorProvider[zio.config.examples.MyConfig.MyClass]
  private val automaticConfig = description[MyClass]

With a list of Tuples automatic Derivation works (but still no idea how the Config Description for this).

final case class MyClass(name: String, params: List[(String, String)])

Is this a restriction? I also couldn't find an example.

pme
  • 14,156
  • 3
  • 52
  • 95
  • There is now a Github Issue: https://github.com/zio/zio-config/issues/186#issuecomment-573474582 – pme Jan 14 '20 at 14:58

1 Answers1

2

As of now zio-config cannot handle if the value of a key is a map. zio-config considererd this as nested configuration (which it can handle quite elegantly) and de-prioritised the feature of having to handle dynamic map.

However, we will considering this as a higher priority, as it turns out there are many usecase that falls into this category and will be included in 1.0.0-RC11, planning to get released by 25th of Jan.

I know this doesn't solve your immediate problem, sorry about that.

Afsal Thaj
  • 93
  • 5