Skip to content

Releases: zio/zio-config

v4.0.2

28 Apr 17:16
41d7474
Compare
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
Compare
Choose a tag to compare
remove outdated comment (#1339)

v4.0.0

27 Dec 16:25
7523fb9
Compare
Choose a tag to compare
add missing DeriveConfig instances (#1309)

v4.0.0-RC16

12 May 16:40
3c7bc43
Compare
Choose a tag to compare

Changes

Minor bug fixes

v4.0.0-RC15

29 Mar 15:41
Compare
Choose a tag to compare
Remove debug in scala3

v4.0.0-RC14

23 Mar 05:20
c5e3fc2
Compare
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

v4.0.0-RC13

09 Mar 20:09
1c9d98d
Compare
Choose a tag to compare

Update

With this release, zio-config stopped considering comma separated values as list, and made it configurable.

Implementation detail

zio-config depends on ZIO's Flat even to handle indexed format with the recent changes and ZIO's Flat always consider list as comma separated. This resulted in reintroducing certain issues where values with comma were considered as list in HOCON, YML etc.

This behaviour is now made configurable within zio-config, with default behaviour as not having any such assumptions.

v4.0.0-RC12

08 Mar 11:29
Compare
Choose a tag to compare

Updates

  • Fix issue in reading boolean values from HOCON
  • Simplify defining custom DeriveConfig instance, by adding mapAttempt into DeriveConfig in both scala2 and scala3

Example:

implicit val zonedDateTimeParse: DeriveConfig[ZonedDateTime] = DeriveConfig[String].mapAttempt(ZonedDateTime.parse)

// instead of
implicit val zonedDateTimeParse: DeriveConfig[ZonedDateTime] = DeriveConfig(deriveConfig[String].mapAttempt(ZonedDateTime.parse))
  • Update documentations

v4.0.0-RC11

07 Mar 00:10
9face84
Compare
Choose a tag to compare

Updates

  • Support period (.) character in keys of YML and JSON/HOCON.
  • Ensure that zio-config works with the orElse combinator of ZIO's ConfigProvider. This allows zio-config's complex configurations to be part of the orElse combinator of ConfigProvider. This also fixes issues such as #1095 along with making sure that we can inject HOCON/YML config providers in ZIO.Runtime
  • Ensure that we support an empty list in YML and XML.
  • Ensure that we keep the order of values in list configurations.

Most of these changes rely on using the latest indexing support in core ZIO's ConfigProvider (2.0.10). See zio/zio#7823 and zio/zio#7891. Therefore this release uses ZIO 2.0.10

v4.0.0-RC10

26 Feb 07:48
17efd3c
Compare
Choose a tag to compare
  • Previously, zio-config mistakenly treated comma-separated values as lists because it used the ConfigProvider.Flat.util.parsePrimitive method internally. This is now fixed, and now we no longer need to use seqDelim to indicate that values should be treated as lists. For example, a list value is always within [] for HOCON/JSON.
  • This fix resolves potential issues like the one described in #1085.
  • XML support has been moved to the experimental stage until it can handle all complex types.