Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9821
Closed
Open
Issue created Jun 22, 2021 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] [R] Circular references break R generator with StackOverflowError

Created by: zliebersbach

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When using a swagger.json file with circular references RClientCodegen.java throws the following exception:

Exception in thread "main" java.lang.StackOverflowError
	at java.lang.StringBuilder.append(StringBuilder.java:136)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:762)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:752)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:771)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:752)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:771)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:752)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:728)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:771)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:752)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:771)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:752)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:728)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:771)
	at org.openapitools.codegen.languages.RClientCodegen.constructExampleCode(RClientCodegen.java:752)
        ...
openapi-generator version

5.2.0 (master)

OpenAPI declaration file content or url

https://api.splashback.io/data/swagger/v1/swagger.json

Generation Details

Simply clone master and build locally as instructed in README.md.

Java version 1.8.0 (OpenJDK), Maven version 3.6.3.

Steps to reproduce

Run openapi-generator-cli with the following arguments:

$ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i swagger.json -g r -o /var/tmp/r_api_client
Related issues/PRs

No related issues could be found.

Suggest a fix

Working on a fix now. Will post if any issues arise!

Assignee
Assign to
Time tracking