-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A partly partial with io-ts #450
Comments
That's not possible |
I appreciate you getting back to me. Is there no workaround that I could create temporarily? All I need to do it validate with these conditions. Could the |
Yes, that's my post which I linked at the beginning, although I didn't reply saying that I found a workaround. If anybody has the same issue, then its possible to create a wrapper around |
I just posted a new question on StackOverflow regarding making a partial from an existing schema.
Any help would be appreciated.
I'm having some issues with using
io-ts
. I've found that its really lacking documentation, most of the progress I've made is through GitHub issues. And no I don't understand the HKTs so no help there.Basically I'm creating a type elsewhere,
type
which has a certain set of keys:And I need to transform this to a partial where some keys are still required. Say just the
id
key is still required, defining the type in TS would be like:Simple!
Now, I want to be able to do this at runtime through
io-ts
so that I can create a validator function with theGuard
module. This is what I've got so far:But the
someType(S)
defines the type as having all keys required, but none of them should be required.The text was updated successfully, but these errors were encountered: