You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the option debugSupportingFiles causes a com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) exception.
This only occurs if a Model-schema reference another model-schema
As (part of) the stack trace point out, the CodegenModel has a "parentModel" property that cause the infinite recursion:
[main] INFO org.openapitools.codegen.DefaultGenerator - ############ Supporting file info ############
com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: org.openapitools.codegen.CodegenModel["parentModel"]->org.openapitools.codegen.CodegenModel["children"]->java.util.ArrayList[0]->org.openapitools.codegen.CodegenModel["parentModel"]->org.openapitools.codegen.CodegenModel["children"]->java.util.ArrayList[0]->org.openapitools.codegen.CodegenModel["parentModel"]->org.openapitools.codegen.CodegenModel["children"]->java.util.ArrayList[0]->org.openapitools.codegen.CodegenModel["parentModel"]->org.openapitools.codegen.CodegenModel["children"]->java.util.ArrayList[0]->org.openapitools.codegen.CodegenModel["parentModel"]
Description
the option
debugSupportingFiles
causes acom.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError)
exception.This only occurs if a Model-schema reference another model-schema
As (part of) the stack trace point out, the
CodegenModel
has a "parentModel" property that cause the infinite recursion:openapi-generator version
OpenAPI declaration file content or url
This is the OpenAPI that generates the issue: https://pastebin.com/c5tQgWQ9
Note: if the line
- $ref: "#/components/schemas/UserDetail"
is removed from the User schema, the exception is not raised.Command line used for generation
java -jar openapi-generator-cli.jar generate -i /path/to/input.yaml -g java -o test/client/petsore/java -DdebugSupportingFiles=true
Steps to reproduce
/path/to/input.yaml
with the content of https://pastebin.com/c5tQgWQ9java -jar openapi-generator-cli.jar generate -i /path/to/input.yaml -g java -o test/client/petsore/java -DdebugSupportingFiles=true
Suggest a fix/enhancement
the call to the debugging method is present in the
buildSupportFileBundle
method oforg.openapitools.codegen.DefaultGenerator
classThe text was updated successfully, but these errors were encountered: