-
Notifications
You must be signed in to change notification settings - Fork 31
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
Issues with generic definitions #3
Comments
This generator seems to just replace |
The issue I ran into this is that flow throws errors on the generated
flowtype.js that we have multiple exports of the interface. Maybe flow
will support this in the future?
…On Mon, Jun 26, 2017, 10:23 AM yayoc ***@***.***> wrote:
This generator
<https://github.com/areijngoudt/swagger-ts-generator/blob/876e52e34ad2708c9a26ac1106c04ec804b06f13/lib/modelGenerator.js#L318-L320>
seems to just replace [ and ] with < and > and typescript also doesn't
allow to declare duplicate generics. At this time, I think replacing [
and ] with < and > would be enough for this library.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAgWoEI3FRnZ1n7U_Xf-fU3SQJ3GRoIrks5sH77EgaJpZM4OEwzY>
.
|
I checked at what https://github.com/swagger-api/swagger-codegen generates for typescript, they basically just remove the generic nature:
I can make this change, are you accepting PR's? |
Yes, please create PR. |
Pull Request #4 waiting to be reviewed. |
If I have definitions such as
This causes an error.
I attempted to solve this by putting in code to replace [ and ] with < and >, however flow doesn't appear to support exporting multiple generic implementations of a class.
I know this is a bit vague, but I didn't have time to scrub together an example. Hopefully this makes sense.
Another possible option, that's not too crazy, would be to drop the last bracket and replace the first with an underscore:
What are your thoughts? How does the swagger typescript generator handle this?
The text was updated successfully, but these errors were encountered: