-
Notifications
You must be signed in to change notification settings - Fork 6k
Feature/typescript angular2 should generate correct output #2917
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
Feature/typescript angular2 should generate correct output #2917
Conversation
…hub.com/Vrolijkx/swagger-codegen # Conflicts: # modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractTypeScriptClientCodegen.java
… into feature/node-promise-cleanup
+ added integration test
| type = swaggerType; | ||
| } | ||
|
|
||
| if (!languageSpecificPrimitives.contains(type)) { |
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.
this will still produce invalid typescript for e.g. Array as with the <> it will not be recognized, my suggestions is to add a starts with check:
private boolean startsWithLanguageSpecificPrimitiv(String type) {
for (String langPrimitive:languageSpecificPrimitives) {
if (type.startsWith(langPrimitive)) {
return true;
}
}
return false;
}
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.
That would be a good workaround for now. Will add it when i have some time.
Personally I think it would be better to start using imports correctly in the future instead of prefixing everything with models.
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.
@brosenberger , how can I reproduce this bug (before @Vrolijkx fix)?
attempt to fix #2906 contains also changes from #2915 so better to review and merge this one first.