Issue with Custom Message in `Schema.optional` vs `Schema.optionalWith`
I don't know if this behaviour is intended or not. I noticed that when I use
For example, here I get the message
I don't have this issue when using
Schema.optional I can't provide a custom message.For example, here I get the message
Expected undefined, actual "" when decoding the input { foo: '' } with IgnoredMessage even though it defines a custom message.I don't have this issue when using
Schema.optionalWith(Foo, { exact: true }), so I suppose the problem comes from some Schema.Union(Foo, Schema.Undefined), that is used internally by Schema.optional and which message is not overridden by the user annotation.optionalWith is probably fine in my use case, but my program does not actually care if the value is missing or undefined, so it breaks the robustness principle.