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
Generator Client for "html2" is failing to render the schemas when they have circular references. Also, SwaggerEditor fails when trying to "Download Resolved JSON/YAML". The error shown is "Maximum call stack size exceeded".
Paste the provided OpenAPI spec content in the corresponding area of the editor.
Click on "File > Download Resolved YAML".
Observe the error thrown by the web app.
Expected behavior
Scenario 1:
Browser's console doesn't display any "Maximum call stack size exceeded" errors, meaning that it processes Circular References correctly and schemas are rendered properly. (Consider using a dictionary of the visited nodes).
Scenario 2:
Browser throws a file to download that includes the resolved YAML file.
Screenshots
Scenario 1:
Scenario 2:
Additional context or thoughts
A similar problemas was resolved in Issue #8537, but they exclusively impacted the Editor's UI and the issue persists in (at least) this other functions. @char0n your input is greatly appreciated. The provided spec file was created specifically to replicate this issue.
The text was updated successfully, but these errors were encountered:
jorgemk85
changed the title
Maximum call stack size exceeded in SwaggerEditor's "Generate Client > html2" and "File > Download Resolved YAML" functions.
"Maximum call stack size exceeded" in SwaggerEditor's "Generate Client > html2" and "File > Download Resolved YAML" functions.
Mar 27, 2024
Your definition contains cycles and even though https://editor-next.swagger.io/ (SwaggerEditor@5) is based on ApiDOM which can handle cycles easily, we still seeing that error.
The issue is that for resolving the definitions, we currently use dereference algorithm (reference removal). Dereferencing can create cycles (circular references) and cycles cannot be serialized into JSON or YAML. In order to resolve this issue properly we need to use bundling algorithm. We've already started some initial work on bundling in swagger-api/apidom#692.
What we can do for now to mitigate the issue (before we have bundling) is to run the dereferencing in replace mode and use circularReplacer to make the circular reference absolute and skip resolving it.
I am using this "https://generator3.swagger.io/index.html#/clients/generate" endpoint to procedurally transform my spec files into "html2" static websites. Could you please indicate how to specify the dereferencing property in the request body? I have tried the following without making any difference:
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
Describe the bug you're encountering
Generator Client for "html2" is failing to render the schemas when they have circular references. Also, SwaggerEditor fails when trying to "Download Resolved JSON/YAML". The error shown is "Maximum call stack size exceeded".
To reproduce...
Steps to reproduce the behavior:
Scenario 1:
Scenario 2:
Expected behavior
Scenario 1:
Browser's console doesn't display any "Maximum call stack size exceeded" errors, meaning that it processes Circular References correctly and schemas are rendered properly. (Consider using a dictionary of the visited nodes).
Scenario 2:
Browser throws a file to download that includes the resolved YAML file.
Screenshots
Scenario 1:
Scenario 2:
Additional context or thoughts
A similar problemas was resolved in Issue #8537, but they exclusively impacted the Editor's UI and the issue persists in (at least) this other functions. @char0n your input is greatly appreciated. The provided spec file was created specifically to replicate this issue.
The text was updated successfully, but these errors were encountered: