Optional indicates that this model property shouldn't be serialized if it isn't present.
Note that if we use optional together with another prop schema such as custom,
the prop schema for custom will be applied first and the result of that serialization
will be used to feed into optional. As such, it might be better to just use custom
with SKIP to achieve the same goal.
Optional indicates that this model property shouldn't be serialized if it isn't present.
Note that if we use
optional
together with another prop schema such ascustom
, the prop schema forcustom
will be applied first and the result of that serialization will be used to feed intooptional
. As such, it might be better to just usecustom
withSKIP
to achieve the same goal.Example