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
Most of the unions we see are of the specific 'nullable type' case: [null, T]. When we fail to find a union branch that matches T we give a fairly generic error:
However, in this specific case we really have only one candidate type that happens to be nullable. Therefore it would be really useful to see why the value does not match T, just as if we were trying to validate against only T (and not a union of T and null).
Providing this error would greatly assist in debugging schemas that have nullable fields, and so is actually not really related to the more general use of the union type.
The text was updated successfully, but these errors were encountered:
Most of the unions we see are of the specific 'nullable type' case:
[null, T]
. When we fail to find a union branch that matchesT
we give a fairly generic error:However, in this specific case we really have only one candidate type that happens to be nullable. Therefore it would be really useful to see why the value does not match
T
, just as if we were trying to validate against onlyT
(and not a union ofT
andnull
).Providing this error would greatly assist in debugging schemas that have nullable fields, and so is actually not really related to the more general use of the
union
type.The text was updated successfully, but these errors were encountered: