swagger-api / swagger-api/swagger-codegen

StackOverflowError on DefaultCodegen.isDiscriminatorInInterfaceTree

Open
#8,926 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

java -jar swagger-codegen-cli-2.3.1.jar generate -i bitbucket.json -l dart -o bitbucket_api -c bitbucket_pr_config.json

[main] INFO io.swagger.parser.Swagger20Parser - reading from bitbucket.json
[main] WARN io.swagger.codegen.ignore.CodegenIgnoreProcessor - Output directory does not exist, or is inaccessible. No file (.swagger-codegen-ignore) will be evaluated.
Exception in thread "main" java.lang.StackOverflowError
	at io.swagger.codegen.DefaultCodegen.isDiscriminatorInInterfaceTree(DefaultCodegen.java:1473)
	at io.swagger.codegen.DefaultCodegen.isDiscriminatorInInterfaceTree(DefaultCodegen.java:1480)
	at io.swagger.codegen.DefaultCodegen.isDiscriminatorInInterfaceTree(DefaultCodegen.java:1480)
	at io.swagger.codegen.DefaultCodegen.isDiscriminatorInInterfaceTree(DefaultCodegen.java:1480)
Swagger-codegen version

swagger-codegen-cli-2.3.1.jar
also happens with 3.0

Swagger declaration file content or url

https://bitbucket.org/api/swagger.json

Command line used for generation

java -jar swagger-codegen-cli-2.3.1.jar generate -i bitbucket.json -l dart -o bitbucket_api -c bitbucket_pr_config.json

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in DefaultCodegen.java at isDiscriminatorInInterfaceTree, using the repeated stack trace at lines 1473 and 1480 to inspect the recursion. Reproduce with swagger-codegen-cli-2.3.1, the Bitbucket swagger.json declaration, and the supplied Dart generation command; done means generation no longer ends in StackOverflowError.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.