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
For a discriminated union it would be more descriptive to use oneOf instead of anyOf. Human readers and non-TS tooling might not be able to tell that because of the interfaces it's not possible to be valid against more than one of the subschemas, so oneOf would be more clear.
Could we get some kind of annotation to put on a union to declare that it's discriminated, or is there some way to directly infer this from the TS compiler's type-checker?
The text was updated successfully, but these errors were encountered:
For a discriminated union it would be more descriptive to use
oneOf
instead ofanyOf
. Human readers and non-TS tooling might not be able to tell that because of the interfaces it's not possible to be valid against more than one of the subschemas, sooneOf
would be more clear.Could we get some kind of annotation to put on a union to declare that it's discriminated, or is there some way to directly infer this from the TS compiler's type-checker?
The text was updated successfully, but these errors were encountered: