zio-config icon indicating copy to clipboard operation
zio-config copied to clipboard

Support of Map[K, V]

Open achinaou opened this issue 11 months ago • 0 comments

Right now, the only supported variant of Map is Map[String, V].

It would be nice to support the case of Map[K, V]:

case class ConfigurationEntryId(value: String) extends AnyVal

object ConfigurationEntryId:

  given DeriveConfig[ConfigurationEntryId] =
    DeriveConfig[String].map(ConfigurationEntryId.apply)

case class ConfigurationEntryDetails(
    first: String,
    second: String
)

case class Configuration(
    all: Map[ConfigurationEntryId, ConfigurationEntryDetails]
)

object Configuration:

  val config: Config[Configuration] = deriveConfig

achinaou avatar Mar 24 '24 23:03 achinaou