RangeError: maximum stack size exceeded error (refers to #18)
porotkin opened this issue · comments
Due to the recent changes, when the schema is being defined as a ref to itself (recursive) with an overridden description
property, it causes the StackOverflow error in json-schema-tree.
Example:
Cat:
type: object
properties:
parents:
type: array
items:
$ref: '#/components/schemas/Cat'
description: Cat's parents
Context
This causes the Error: Stack size exceeded
rendering on HttpOperation node where such schema is referenced
Current Behavior
Expected Behavior
The schema is rendered correctly and doesn't make the page to load till the stack size is exceeded (provoking the browser page unresponsiveness)
Possible Workaround/Solution
#18 caused this
newFragment = { ...newFragment };
- this is the line in walker.js
file causing the referential inequality that later as far as I grasped leads to the infinite ref resolving
Steps to Reproduce
- just copy such schema to any existent OAS specification and try to open it in Elements
Environment
- Version used: 2.2.2
- Environment name and version (e.g.
Chrome: 39
,node.js: 5.4
): Chrome latest - Operating System and version (desktop or mobile): macOS
- Link to your environment/workspace/project: -
Hello ! We still have this problem. Has anyone found a solution?
🎉 This issue has been resolved in version 2.3.0 🎉
The release is available on:
Your semantic-release bot 📦🚀