All Versions
27
Latest Version
Avg Release Cycle
87 days
Latest Release
528 days ago
Changelog History
Page 3
Changelog History
Page 3
-
v0.8.0 Changes
August 27, 2017๐ New features
loadConfig
methods now allow loading any type from a config when using a namespace, and not only types represented by config objects;ConfigFieldMapping
now has awithOverrides
method that allows users to easily define exceptional cases to an existing mapping;ConfigReader
andConfigWriter
forjava.math.BigDecimal
andjava.math.BigInteger
;ConfigReader
forBoolean
s allows reading them from "yes", "no", "on" and "off" strings;ConfigReader
andConfigWriter
forshapeless.HList
;ConfigReader
for Scala tuples can now read fromConfigLists
s;- Added an experimental way to debug when a converter fails to be derived because an implicit is not found. See the documentation for more information on how to enable it.
๐ฅ Breaking changes
ConfigWriter
for tuples now writes them asConfigList
s, instead of aConfigObject
with keys_1
,_2
, and so on.
๐ Bug fixes
- A breaking change introduced in v0.7.1 where
loadConfigFromFiles
stopped allowing missing files was reverted; loadConfig
methods no longer throw an exception when passed a namespace where one of the keys is not a config object;- The
xmap
ofConfigConvert
and themap
method ofConfigReader
now wrap exceptions that the functions used to map might throw in aConfigReaderFailure
; FieldCoproductHint
now removes the disambiguating key from the config object before passing it to the reader of a coproduct option.
- A breaking change introduced in v0.7.1 where
-
v0.7.2 Changes
May 29, 2017- ๐ Bug fixes
- Fix value class
ConfigReader
andConfigWriter
derivation [#253].
- Fix value class
- ๐ Bug fixes
-
v0.7.1 Changes
May 28, 2017- ๐ New features
ConfigReader
,ConfigWriter
andConfigConvert
now have combinators such asmap
,flatMap
andcontramap
, making them easier to compose;- New mechanism to read and write value classes. The readers and writers of the inner type are used instead of the ones for products;
- New
EnumCoproductHint
for sealed families of case objects where objects are written and read as strings with their type names; ConfigReader
andConfigWriter
instances forPattern
andRegex
;ConfigReader
andConfigWriter
instances forjava.time.Duration
;ConfigReader
andConfigWriter
forjava.io.File
;ConfigReader
andConfigWriter
for arbitrary Javaenum
s;- Improved error messages when a failure occurs reading a config;
- ๐ Bug fixes
Duration.Undefined
is correctly handled when reading and writing configurations [#184];loadConfig
method now handles properly cases where a requested config file cannot be read and when a provided namespace doesn't exist.
- ๐ New features
-
v0.7.0 Changes
April 02, 2017๐ New features
ConfigConvert
is now a union of two new traits -ConfigReader
for reading configs andConfigWriter
for writing them:- Having an implicit
ConfigReader
in scope is enough to read a config to a instance of a given type; - Having a
ConfigWriter
is enough for writing instances to configs; ConfigConvert
can still be used everywhere it was before and is advisable when both operations are needed.- Many constructors for
ConfigConvert
instances were deprecated, while new ones were added in the companion objects ofConfigReader
,ConfigWriter
andConfigConvert
. The deprecation message of each one indicates the new method to use; - Add
ConfigFactoryWrapper
to control exceptions from typesafeConfigFactory
; - Modify the message of
ConfigReaderException
to group errors by keys in the configuration, instead of by type of error; - Add a path (
Option[String]
) toConfigReaderFailure
, in order to expose more information (if available) about the key in the configuration whose value raised the failure.
๐ฅ Breaking changes
loadConfigFromFiles
works onPath
instead ofFile
for consistency;ConfigValueLocation
now usesURL
instead ofPath
to encode locations ofConfigValue
s.
๐ Bug fixes
pureconfig.load*
methods don't throw exceptions on malformed configuration anymore and wrap errors inConfigReaderFailures
[#148].
-
v0.6.0 Changes
February 14, 2017๐ New features
- New
ProductHint
trait allowing customization of the derivedConfigConvert
for case classes, superseedingConfigFieldMapping
(docs). In addition to defining field name mappings,ProductHint
instances control: - Whether default field values should be used when fields are missing in the config (docs);
- Whether unknown keys are ignored or cause pureconfig to return a
Failure
(docs). - Support for reading and writing
java.util.UUID
s; - Support for reading and writing
java.nio.file.Path
s; - Support for reading and writing
java.net.URI
s; - Support multiple failures, e.g. when multiple fields of a class fail to convert;
- Add
ConfigReaderFailure
ADT to model failures andConfigReaderFailures
to represent a non empty list of errors; - Add
ConfigValueLocation
, which is the physical location of a ConfigValue represented by a file name and a line number; - Add
loadConfigOrThrow
methods to the API; - Add helpers to create
ConfigConvert
: ConfigConvert.fromStringConvert
that requires a functionString => Either[ConfigReaderFailure, T]
ConfigConvert.fromStringConvertTry
that requires a functionString => Try[T]
ConfigConvert.fromStringConvertOpt
that requires a functionString => Option[T]
- Add
ConfigConvert.catchReadError
to convert a function that can throw exception into a safe function that returns aEither[CannotConvert, T]
;
- New
๐ฅ Breaking changes
ConfigConvert.from
now returns a value of typeEither[ConfigReaderFailures, T]
instead ofTry[T]
;CoproductHint
has been changed to adapt to the newConfigConvert
:CoproductHint.from
now returns a value of typeEither[ConfigReaderFailures, Option[ConfigValue]]
CoproductHint.to
now returns a value of typeEither[ConfigReaderFailures, Option[ConfigValue]]
- The default field mapping changed from camel case config keys (e.g.
exampleKey
) to kebab case keys (e.g.example-key
). Case class fields are still expected to be camel case. The old behavior can be retained by putting in scope animplicit def productHint[T] = ProductHint[T](ConfigFieldMapping(CamelCase, CamelCase))
; ConfigFieldMapping
has no type parameters now;ConfigFieldMapping
was replaced byProductHint
as the type of object to put in scope in order to customize the derivation ofConfigConvert
for case class. OldConfigFieldMapping
implicit instances in scope have no effect now. The migration can be done by replacing code likeimplicit def mapping: ConfigFieldMapping[T] = <mapping>
withimplicit def productHint: ProductHint[T] = ProductHint(<mapping>)
;ConfigConvert.fromString
,ConfigConvert.fromNonEmptyString
,ConfigConvert.vstringConvert
,ConfigConvert.nonEmptyStringConvert
are now deprecated and the new helpers should be used instead.
-
v0.5.1 Changes
January 20, 2017- ๐ New features
- More consistent handling of missing keys: if a config key is missing pureconfig always throws a
KeyNotFoundException
now, unless theConfigConvert
extends the newAllowMissingKey
trait. - Add support for the
java.time
package. Converters types which support different string formats, such asLocalDate
, must be configured before they can be used. See the documentation for more details. - Add support for converting objects with numeric keys into lists. This is a functionallity also supported by typesafe config since version 1.0.1 and discussed in the following issue.
- More consistent handling of missing keys: if a config key is missing pureconfig always throws a
- ๐ New features
-
v0.5.0 Changes
January 03, 2017- ๐ New features
- Sealed families are now converted to and from configs unambiguously by using an extra
type
field (customizable) in their config representation; - New
CoproductHint
trait which allows customization of the derivedConfigConvert
for sealed families;
- Sealed families are now converted to and from configs unambiguously by using an extra
- ๐ฅ Breaking changes
- The default config representation for sealed families has changed:
- By default pureconfig now expects to find a
type
field containing the lowercase simple class name of the type to be read. For example, for a family includingDogConf
andCatConf
, pureconfig expects to find atype: "dogconf"
field in the config file; - The old behavior can be restored by putting an implicit instance of
FirstSuccessCoproductHint
in scope (the migration to the new format is strongly recommended though, as the previous one may lead to ambiguous behavior); - More information about the default representation and on how to customize it can be seen in the documentation.
- ๐ Bug fixes
0
is accepted again as a validDuration
in configs.
- ๐ New features