-
Notifications
You must be signed in to change notification settings - Fork 509
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
Nullable information is lost with Typescript Utility Type (Pick, Partial, ...) #1515
Comments
I have also ran into this issue! I upgraded from 5.1.1 to this 6.0.0-rc.5 in order to fix this issue with Omit and PIck: #1238, and now am losing the nullable in the generated swagger |
I created a failing unit test for this: https://github.com/gcv-epalmer/tsoa-test Tried my hand at fixing the bug but I think I'm a bit over my head. My best guess is that the TypeResolver doesn't play super nicely with reference/mapped types |
I also encountered this issue while bumping tsoa from 5.1.1 to 6.0.0, I confirm that I lost the
I lose |
Encountered this as well, attempted to fix it by taking a 4 hour deep dive into this library's internals & typescript AST, and noted the fact that if you enable Noteworthy however is that with |
Are there any updates on this? I'd like to get rid of the |
@JoranLive, could you explain how is this fixed? I'm having the same issue. I define a property like:
But when passing null to it, TSOA throws:
Thanks! |
@vedtam , the workaround is adding |
@dsambugaro thanks, but compilerOptions aren't taken from |
@vedtam the {
"spec": {
...
},
"routes": {
...
},
"compilerOptions": {
"strictNullChecks": true,
}
} |
@dsambugaro got it, thanks! |
@vedtam does it work for you? |
Can confirm that |
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Current Behavior
Possible Solution
make nullable information not to be lost
Steps to Reproduce
npx tsoa spec
Context (Environment)
Version of the library: [email protected]
Version of NodeJS: v18.15.0
Detailed Description
Thank you in advance for your development and maintenance for this awesome framework!
I love and use in production this :)
I confirmed that
nullable
is lost when defining types withPick
andPartial
andExclude
.This didn't happen (
nullable
is NOT lost) in[email protected]
.Please let me know if I can provide any more information.
Breaking change?
NO
The text was updated successfully, but these errors were encountered: