-
-
Notifications
You must be signed in to change notification settings - Fork 544
Support for Dictionaries, HashMaps and Associative Arrays #92
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
Comments
🤗
While a PR would be greatly appreciated, it would be pretty sizable in scale because this is part of the version 3 spec which isn’t currently supported (though it’s probably high time this library added that support). I think this library probably needs a rewrite to be a bit more maintainable (I wrote it before becoming more comfortable with lexers, which I’d like to use moving forward, but, hey, everyone’s gotta start somewhere! Even Babel’s first version was sebmck’s first crack at it). What I’ll do is open an issue to support Swagger v3 specs, and close this one, if that’s all right. Hopefully this will be taken care of by that. |
@Saegrov I apologize—this isn’t unique to v3 at all! This was actually a bug. This library did support Also updated the tests with your exact example to ensure this stays working. |
@DangoDev Sweet! Thank you very much! |
Hey! Unfortunately, it seems like |
Swagger has support for describing the types for HashMaps but currently swagger-to-ts only types these as
object
.Swaggerdocs on this: https://swagger.io/docs/specification/data-models/dictionaries/
Example
Given this json:
Created from this Java class
I get this result where the
option
property gets typed asobject
The result I wanted in this case was:
Or if you want to support Typescript lower than 2.1:
I'm happy to provide a PR if you want. Great library!
The text was updated successfully, but these errors were encountered: