Skip to content

Releases: zio/zio-config

v4.0.6

25 Nov 07:18
1327f6e

Choose a tag to compare

What's Changed

v4.0.5

12 Sep 08:05
ccb3a8d

Choose a tag to compare

What's Changed

v4.0.4

15 Mar 16:45
d0682b5

Choose a tag to compare

What's Changed

  • feat: publish dotty version for cross builds by @mhriemers in #1497
  • Table.toGithubFlavouredMarkdown: link to section heading anchors by @igneus in #1543

New Contributors

Full Changelog: v4.0.3...v4.0.4

v4.0.3

30 Dec 11:30
dc90707

Choose a tag to compare

Highlights

This release brings a new feature for Scala 3 that allows users deriving Config instances using the Scala 3 derives keyword.
The syntax is enabled by adding the import zio.config.magnolia.* import in the file where the case class / sealed trait is defined:

import zio.Config
import zio.config.magnolia.*

case class Foo(key1: String, key2: Int) derives Config

What's Changed

New Contributors

Full Changelog: v4.0.2...v4.0.3

v4.0.2

28 Apr 17:16
41d7474

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.0.1...v4.0.2

v4.0.1

17 Jan 08:26
9fcf0b7

Choose a tag to compare

remove outdated comment (#1339)

v4.0.0

27 Dec 16:25
7523fb9

Choose a tag to compare

add missing DeriveConfig instances (#1309)

v4.0.0-RC16

12 May 16:40
3c7bc43

Choose a tag to compare

Changes

Minor bug fixes

v4.0.0-RC15

29 Mar 15:41

Choose a tag to compare

Remove debug in scala3

v4.0.0-RC14

23 Mar 05:20
c5e3fc2

Choose a tag to compare

Updates

  • Add type-discriminator support for scala-3 auto derivation. Note that this support already existed in scala-2 auto derivation
import zio.config._, magnolia._, typesafe._

@nameWithLabel("type")
sealed trait FooBar

case class Foo(name: String) extends FooBar
case class Bar() extends FooBar

case class MyConfig(a: FooBar, b: FooBar)

val hocon = 
 s"""
   {
     a : {
       type : Foo
       name : baz
     },

     # Bar is just name since it has no fields, and therefore no need of type descriminator 
     b : Bar
   }

 """

ConfigProvder.fromHoconString(hocon).load(deriveConfig[MyConfig])

Find more examples here:

https://github.com/zio/zio-config/tree/series/4.x/magnolia/shared/src/main/scala-dotty/zio/config/magnolia/examples

https://github.com/zio/zio-config/blob/series/4.x/examples/shared/src/main/scala/zio/config/examples/autoderivation/AutoDerivationPureConfig.scala