Skip to content
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

Type discriminator properties have wrong type when using generic interfaces #181

Closed
Yona-Appletree opened this issue Sep 27, 2017 · 0 comments

Comments

@Yona-Appletree
Copy link
Contributor

Given the java type hierarchy:

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY)
private interface WithoutTypeParam {}

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY)
private interface WithTypeParam<T> {}

private class Implementation implements WithTypeParam<Integer>, WithoutTypeParam {}

The @type property for WithoutTypeParam is correct: "Implementation"

But the @type property for WithTypeParam is incorrect: string

This is because in cz.habarta.typescript.generator.compiler.ModelCompiler#createChildrenMap the children map is built using the parameterized type WithTypeParam<Integer>, but when cz.habarta.typescript.generator.compiler.ModelCompiler#getSelfAndDescendants looks for implementations of WithTypeParam it uses the unparameterized type.

I have a fix for this, and am creating the slip to track the issue.

Yona-Appletree pushed a commit to Yona-Appletree/typescript-generator that referenced this issue Sep 27, 2017
…ces when computing discriminator union type
Yona-Appletree pushed a commit to Yona-Appletree/typescript-generator that referenced this issue Sep 27, 2017
…ces when computing discriminator union type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant