Insomnia: [Bug] Maximum call stack size exceeded

Created on 8 Feb 2019  ยท  14Comments  ยท  Source: Kong/insomnia

Details

When running the code below with a file specification.yml which is a swagger 2.0 documentation I retrieve the error below. The original file size was ~110kb but I also reduced the size to around ~15kb but it still didn't work. Someone else encountered this problem also but he didn't create an issue, the comment can be found here.

const fs = require("fs");
const importers = require("insomnia-importers");

fs.readFile("specification.yml", async (err, data) => {
  if (err) throw err;

  try {
    const output = await importers.convert(data.toString());
    console.log(JSON.stringify(output.data, null, 2));
  } catch (error) {
    console.log("error", error);
  }
});
error RangeError: Maximum call stack size exceeded
    at Array.forEach (<anonymous>)
    at object (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:300:31)
    at generateParameterExample (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:332:12)
    at Object.keys.forEach.propertyName (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:301:33)
    at Array.forEach (<anonymous>)
    at object (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:300:31)
    at generateParameterExample (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:332:12)
    at Object.keys.forEach.propertyName (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:301:33)
    at Array.forEach (<anonymous>)
    at object (/PATH/node_modules/insomnia-importers/src/importers/swagger2.js:300:31)
accepted good first issue help wanted

Most helpful comment

Just stumbled upon this myself, e.g. https://github.com/MicrosoftDocs/vsts-rest-api-specs/blob/master/specification/build/5.0/build.json will fail with "Maximum call stack size exceeded".

All 14 comments

๐Ÿ‘‹ Thanks for opening your first issue! If you're reporting a ๐Ÿž bug, please make sure
you include steps to reproduce it. If you're requesting a feature ๐ŸŽ, please provide real
use cases that would benefit. ๐Ÿ‘ช

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Can you provide a sample import file that can be used to reproduce this?

Can you provide a sample import file that can be used to reproduce this?

Any big config file will do.

P.S. Same problem with swagger json.
P.S.P.S. I have 29k line json for eg.

Without a file to use to reproduce the issue, there's no way I can help fix it. Please provide a sample file if this is still an issue.

Just stumbled upon this myself, e.g. https://github.com/MicrosoftDocs/vsts-rest-api-specs/blob/master/specification/build/5.0/build.json will fail with "Maximum call stack size exceeded".

Even I am facing same kind of issue when importing huge data, as I am trying to deploy my application's swagger file I couldn't share here.
Screenshot 2020-04-29 at 9 13 40 PM

@gschier could you take a look at the example file @tobylo provided? Thanks!

Still an issue. How is this going? has anyone take a look at this since 2019?

Still an issue. How is this going? has anyone take a look at this since 2019?

nope. no one cares.
tho its big drawback... :/ and just needs small fix.
the only way i suppose to make a pull request.

I have same issue for OpenAPI 3 and Swagger 2.0 documents :/

I am also facing the same issue. My finding is - when you have a relation between 2 classes and they have each other as a property then Swagger UI stuck in a loop.

Same problem trying to upload swagger.json

image

The problem occurs while generating examples for an object, calls again the function and the loop never closes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oliverjanik picture oliverjanik  ยท  3Comments

rootext picture rootext  ยท  3Comments

claratorres picture claratorres  ยท  3Comments

wimdecorte picture wimdecorte  ยท  3Comments

artoodeeto picture artoodeeto  ยท  4Comments