You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a field has no default set, it is marked as required and Specify will raise when nothing ends up being passed.
When a field has a default set, this is what Specify will fall back to.
When optional: true is set (and there is no default set), Specify will accept the value nil on top of what the field parser accepts, and will use this as fallback-value.
I encountered the usefulness of this while writing Blocked.Config where most of the fields are optional. Since Specify currently does not accept nil as default when the parser e.g. is string or boolean, this becomes a problem.
The text was updated successfully, but these errors were encountered:
The idea is as follows:
required
and Specify will raise when nothing ends up being passed.optional: true
is set (and there is no default set), Specify will accept the valuenil
on top of what the field parser accepts, and will use this as fallback-value.I encountered the usefulness of this while writing Blocked.Config where most of the fields are optional. Since Specify currently does not accept
nil
as default when the parser e.g. isstring
orboolean
, this becomes a problem.The text was updated successfully, but these errors were encountered: