question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError: Maximum call stack size exceeded when using recursive schema's

See original GitHub issue

When generating our postman collection for our open api spec we get an exception. Our schema’s do have some recursive calls, for example:

Screenshot 2021-11-30 at 12 02 11

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:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ls-liesbeth-dekeyzercommented, Nov 30, 2021

Its not yet publicly available. I added here (I couldnt add it as a openapi.json file)

openapi.txt

0reactions
nicklloydcommented, Dec 1, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found