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
Some base schema defined some fields as optional, but when used in a concrete situation, we may need to assume it as required. It would be good to have revert operators such as required() and notNull
The text was updated successfully, but these errors were encountered:
This seems to be a feature request rather than a question. If you provide some example code then I can provide a workaround for you. Maybe .extend() should work for your case:
Well, I think required is a reasonable feature to implement as is. As for notNull (I prefer nonNull BTW), we should implement a feature like .exclude() e.g. Union(A, B).exclude(B) === Union(A) at first, since nullable types are just Unions including Null as their alternatives, and then implement .nonNull() as an alias for .exclude(Null).
Cool~ look forword to
The problem of current extend workaround is, we have to have knowledge of the original field to make it again, which is duplicated and weak.
Okay, then you can use Optional(A).underlying to unwrap it for now, but it should be deprecated and replaced soon by .required() which has more understandable name.
Some base schema defined some fields as optional, but when used in a concrete situation, we may need to assume it as required. It would be good to have revert operators such as
required()
andnotNull
The text was updated successfully, but these errors were encountered: