-
Notifications
You must be signed in to change notification settings - Fork 379
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 types nullable #312
make types nullable #312
Conversation
Hey there, thanks for the contribution! I don't see |
I looked into it. It was a fault on my part. |
@bcherny We also encountered this issue with nullable types. What do you think about supporting OpenAPI, are any changes needed for this PR or is it out of scope at all? |
Let's support this, but I'd suggest a slightly different implementation: instead of handling That way downstream code doesn't need to know anything about // normalizer.ts
rules.set('OpenAPI: Convert isNullable to union with null', schema => {
// ...
} This PR also needs a unit test for your new normalizer rule, as well as an e2e test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Let's take one more pass at this.
@zone117x I appreciate if someone else could take over. My workload does not allow me to work at anything else right now. |
I might be able to work on it if @bcherny is available for reviewing the PR and giving guidance where needed (for example how the tests should be structured, etc) |
Superseded by #411 |
Hey.
Was using your typescript compiler for a while and noticed there is no support for the nullable flag. I tried to implement a solution. I hope it satisfies you enough to make it into the main repository. Would be pleased to use this feature in future.
Ps. I implemented a solution that works for me. I cannot promise every possible nullable flag will work with those changed. The most important ones should be covered.
Supported are all basic types and unnamed enums. Named enums, objects and Interfaces shouldn`t be covered.
Regards