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

Recursive Type Exception #1292

Closed
jeusdi opened this issue Sep 24, 2015 · 2 comments
Closed

Recursive Type Exception #1292

jeusdi opened this issue Sep 24, 2015 · 2 comments

Comments

@jeusdi
Copy link

jeusdi commented Sep 24, 2015

I've created a DTO that contains a list of objects of the same class:

class Dto {
    private String id;
    private List<Dto> subDtos;
    //...
}

When I remove this property, codegen works fine. It seems the problem is around that.

Exception in thread "main" java.lang.RuntimeException: Could not generate model
'DigitalResourceDTO'
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:17
4)
at io.swagger.codegen.cmd.Generate.run(Generate.java:188)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.languages.CSharpClientCodegen.getSwaggerType(CShar
pClientCodegen.java:230)
at io.swagger.codegen.DefaultCodegen.getTypeDeclaration(DefaultCodegen.j
ava:521)
at io.swagger.codegen.languages.CSharpClientCodegen.getTypeDeclaration(C
SharpClientCodegen.java:223)
at io.swagger.codegen.languages.CSharpClientCodegen.getTypeDeclaration(C
SharpClientCodegen.java:216)
at io.swagger.codegen.DefaultCodegen.fromProperty(DefaultCodegen.java:78
9)
at io.swagger.codegen.DefaultCodegen.addVars(DefaultCodegen.java:1433)
at io.swagger.codegen.DefaultCodegen.fromModel(DefaultCodegen.java:624)
at io.swagger.codegen.DefaultGenerator.processModels(DefaultGenerator.ja
va:608)
at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:14
8)
... 2 more

@wing328
Copy link
Contributor

wing328 commented Sep 24, 2015

@jeusdi The issue should have been addressed before #728

Are you using the latest version of swagger-codegen (master)? Do you mind sharing the swagger spec for repeating the issue?

I did a test trying to repeat the issue but couldn't.

@wing328
Copy link
Contributor

wing328 commented Sep 30, 2015

@jeusdi we're closing this issue for now as we've not heard from you.

@wing328 wing328 closed this as completed Sep 30, 2015
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

2 participants