-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[typescript] Fix: any type (8 liner PR) #10080
Conversation
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 @lwj5 !
I'm currently looking at the earlier fix for other TS generators that addresses the same problem: https://github.com/OpenAPITools/openapi-generator/pull/6335/files#diff-e07b04e9dd1e4acea6c1d994fd38512f06fa272ca70e4bca3e8d9126e74e5ca0R167
It looks like in addition to the type mapping, that PR also removes any
from composite type, thus avoiding things like MyModel & any
in common use cases (which in TS is the same as any
- hence unnecessarily loosens types).
Any thoughts about doing the same here?
@amakhrov yes I noticed #6335 as well. When I opened the TS generator I saw that those changes were already there, only this line was missed out. |
p.s. checking again I realised |
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!
It looks good to me.
Maybe also consider adding some tests?
Sure, done :) |
In the future we may consider extending TypeScriptClient class with |
1 line change to fix Anytype in TS client.
Regenerated all samples but no changes.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
,5.3.x
,6.0.x
@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02)