Skip to content
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

Make it easier to specify partial types #196

Closed
tonyxiao opened this issue Aug 8, 2018 · 2 comments
Closed

Make it easier to specify partial types #196

tonyxiao opened this issue Aug 8, 2018 · 2 comments

Comments

@tonyxiao
Copy link

tonyxiao commented Aug 8, 2018

There's this amazing tool to generate io-ts from json - https://transform.now.sh/json-to-io-ts

However it doesn't work with optional attributes. The current way (https://github.com/gcanti/io-ts#mixing-required-and-optional-props) of specifying partial is really complex / cumbersome. Could we support syntax like

const MyType = t.type({
  requiredField: t.number,
  optionalField: t.optional(t.string)
})
@gcanti
Copy link
Owner

gcanti commented Aug 8, 2018

I wish... (see #140)

@tonyxiao
Copy link
Author

tonyxiao commented Aug 8, 2018

awww :( That's too bad. Any workaround you would recommend?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants