OptionOrNull
Represents either a value, a missing field, or a null field
Normally you would only need Option
but this type exists for use with APIs that
make a distinction between a json field being null
and being missing altogether
Ensure you set nullAsUndefined
and emptyEncodeAsNull
to false in your jsonOptions
eg: core.jsonwithoptions { emptyencodeasnull: bool.false, nullasundefined: bool.false }
OptionOrNull val
none
Missing field
null
Null
some
Some value
get
Get option internals.
For access to convinence methods and error accumulation you may want Option.getResult
getResult
Option as a result