Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DeriveConfig instances for NonEmptyChunk #1455

Open
wants to merge 2 commits into
base: series/4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ addCommandAlias(

val awsVersion = "1.12.721"
val zioAwsVersion = "5.19.33.2"
val zioVersion = "2.0.13"
val zioVersion = "2.1.9"
val magnoliaVersion = "0.17.0"
val refinedVersion = "0.11.1"
val pureconfigVersion = "0.16.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package zio.config.magnolia

import magnolia._
import zio.config._
import zio.{Chunk, Config, LogLevel}
import zio.{Chunk, NonEmptyChunk, Config, LogLevel}

import java.net.URI
import java.time.{LocalDate, LocalDateTime, LocalTime, OffsetDateTime}
Expand Down Expand Up @@ -75,6 +75,9 @@ object DeriveConfig {
implicit def implicitChunkDesc[A: DeriveConfig]: DeriveConfig[Chunk[A]] =
DeriveConfig(Config.chunkOf(DeriveConfig[A].desc))

implicit def implicitNonEmptyChunkDesc[A: DeriveConfig]: DeriveConfig[NonEmptyChunk[A]] =
DeriveConfig(Config.nonEmptyChunkOf(DeriveConfig[A].desc))

implicit def implicitMapDesc[A: DeriveConfig]: DeriveConfig[Map[String, A]] =
DeriveConfig(Config.table(implicitly[DeriveConfig[A]].desc))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ object DeriveConfig {
given chunkDesc[A](using ev: DeriveConfig[A]): DeriveConfig[Chunk[A]] =
DeriveConfig.from(chunkOf(ev.desc))

given nonEmptyChunkDesc[A](using ev: DeriveConfig[A]): DeriveConfig[NonEmptyChunk[A]] =
DeriveConfig.from(nonEmptyChunkOf(ev.desc))

given mapDesc[A](using ev: DeriveConfig[A]): DeriveConfig[Map[String, A]] =
DeriveConfig.from(table(ev.desc))

Expand Down
Loading