Add ability to specify config parameters types.
One of the main reasons is to give more control on how values are type casted.
Closes #75.
Closes #82.
What changes did you make? (overview)
[x] Added .disable_auto_cast! method to disable automatic type casting (mostly used for ENV vars)
[x] Added .coerce_types method, which allows to provide a (partial) type map for the config parameters.
Is there anything you'd like reviewers to focus on?
The current implementation moves type casting from env to config, thus, changing the way we treat non-ENV sources: now all values set during the load phase are type-casted. That could potentially lead to breaking changes in case a string auto-casted as array would occur.
What is the purpose of this pull request?
Add ability to specify config parameters types. One of the main reasons is to give more control on how values are type casted.
Closes #75. Closes #82.
What changes did you make? (overview)
.disable_auto_cast!
method to disable automatic type casting (mostly used for ENV vars).coerce_types
method, which allows to provide a (partial) type map for the config parameters.Is there anything you'd like reviewers to focus on?
The current implementation moves type casting from env to config, thus, changing the way we treat non-ENV sources: now all values set during the load phase are type-casted. That could potentially lead to breaking changes in case a string auto-casted as array would occur.
Checklist