Replies: 1 comment
-
You can use export const membershipCreateBodySchema = _MembershipModel.extend({
accepted: _MembershipModel.shape.accepted.default(false),
role: _MembershipModel.shape.role.default("MEMBER"),
disableImpersonation: _MembershipModel.shape.disabledImpersonation.default(false),
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this playground
I'm trying to mix
.partial
with.default
but I think the default only works when the parse value is undefined. So how it would be the best way to add a default value to each individual property?Note that I cannot modify the original schema as it is auto-generated.
EDIT: Added resulting type
Beta Was this translation helpful? Give feedback.
All reactions