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
This works really, well, however I would love to add a referenceToken which does NOT have a $type property. This is the only one without the $type property so this is how it could be differentiated. But I don't know how I can implement this in zod. Any ideas? Is this even possible?
The text was updated successfully, but these errors were encountered:
Can you give me some examples so I can test this properly?
And as well can you give me the schema on which to test this?
In any case, I believe you can achieve this with .default() as it can give some default value to the key if the key does not exist in the schema.
Hey, basically I am validating some json. I have the following setup:
This works really, well, however I would love to add a
referenceToken
which does NOT have a$type
property. This is the only one without the$type
property so this is how it could be differentiated. But I don't know how I can implement this in zod. Any ideas? Is this even possible?The text was updated successfully, but these errors were encountered: