Skip to content

Conversation

@Vrolijkx
Copy link
Contributor

attempt to fix #2906 contains also changes from #2915 so better to review and merge this one first.

type = swaggerType;
}

if (!languageSpecificPrimitives.contains(type)) {

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;
}

Copy link
Contributor Author

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.

Copy link

@reinerRubin reinerRubin Nov 15, 2016

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)?

@wing328 wing328 merged commit e1367ee into swagger-api:master May 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[typescript-angular2] Error occurs while build generated typescript-angular2 from master branch

4 participants