-
Notifications
You must be signed in to change notification settings - Fork 498
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
Add default number type configuration #1439
Add default number type configuration #1439
Conversation
Is there any way to escape from having integers when I have a ts type number? IMO that has to be there otherwise it's simpler to just use a custom template. |
Not sure what you mean by "escape from having integers when I have a ts type number". When a ts type is number, tsoa defaults to
Only if I set the default to
The default behaviour is unchanged. |
So assume I want to have a double field now: interface T {
id: number // this is now fine without @isInt
amount: number // <--- how do I make this a double ?
} |
There is a |
Makes sense, I wasn't sure if that could override the integer though. |
43552e2
to
eab7896
Compare
eab7896
to
368d2ac
Compare
@WoH Hi, sorry for the delay. I've added the tests. Had some troubles with different formatting settings, .editorconfig might need some love. |
Co-authored-by: Wolfgang Hobmaier <wolfgang@hey.com>
Co-authored-by: Wolfgang Hobmaier <wolfgang@hey.com>
Co-authored-by: Wolfgang Hobmaier <wolfgang@hey.com>
Hi, some time back I've asked about default number types, but unfortunately the issue was closed as stale - #1408. I went ahead and implemented it anyway as it is super useful for my project. I think it's quite useful, as double as the default number type isn't suitable, if the backend uses for example number ids for entities. The amount of annotation is then just too damn high.
I wasn't sure how to write proper test for this, as I could find any configuration tests.
All Submissions:
Closing issues
Put
closes #1408
If this is a new feature submission:
Potential Problems With The Approach
Test plan