RangeError: Maximum call stack size exceeded when using recursive schema's
See original GitHub issueWhen generating our postman collection for our open api spec we get an exception. Our schema’s do have some recursive calls, for example:
This is a part of our open api spec file
"menuEntryGroups": {
"items": {
"oneOf": [
{
"title": "menuGroupEntry",
"properties": {
"name": {
"example": "drinks",
"type": "string"
},
"color": {
"example": "blue",
"type": "string"
},
"menuEntry": {
"$ref": "#/components/schemas/menuEntry"
},
"type": {
"enum": ["group", "menuItem", "menuDeal"],
"example": "group",
"type": "string"
}
},
"type": "object"
}
Is this a bug or could I fix this by adding some extra options?
error: RangeError: Maximum call stack size exceeded
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:39:16)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
at crawl (/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apidevtools/json-schema-ref-parser/lib/bundle.js:77:11)
/Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apideck/portman/dist/Portman.js:217
throw new Error("Parsing " + openApiSpec + " failed.");
^
Error: Parsing ./tmp/converted/spec.yml failed.
at /Users/liesbeth.de.keyzer/Documents/workspace/api-platform/node_modules/@apideck/portman/dist/Portman.js:217:39
error Command failed with exit code 1.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >Recursive jsonSchema maximum call stack - Stack Overflow
I'm having issues with a self referencing jsonSchema. ... Maximum call stack size exceeded -- does your implementation allow raising the ...
Read more >Recursive references in object types result in maximum call ...
I have tried to model this using the JSON Schema outlined in the reproduction steps below, however it results in my server crashing...
Read more >JavaScript Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >maximum call stack size exceeded typescript - You.com
The RangeError: Maximum call stack size exceeded occurs when a function is being called so many times that the invocations exceed the call...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Its not yet publicly available. I added here (I couldnt add it as a openapi.json file)
openapi.txt
v1.12.0 has been released. Please give it a spin and let us know if this suits your case.
Your options are described here: https://github.com/apideck-libraries/portman/blob/main/docs/ERRORS.md.
I’ll closed this issue for now, but please reopen or create a new one if needed.