Closed keathley closed 4 years ago
I like this. It probably requires a Readme update particularly that last bit "Defaults should always skip the map function." That makes sense but might surprise some people
Yeah all of this still needs to be added to the README.
After this PR, env and file providers will allow users to pass options for each "binding". The initial options are
map
,required
, anddefault
.map
allows users to pass a translation (a mapping function) alongside a binding. If a binding is marked asrequired: false
then vapor will return the key withnil
as the value. If a binding has adefault
and the value specified in the binding is missing then the default is provided. Defaults should always skip themap
function.Example