Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM] Maximum call stack size exceeded #96

Open
ArcturusZhang opened this issue Dec 16, 2019 · 2 comments
Open

[MM] Maximum call stack size exceeded #96

ArcturusZhang opened this issue Dec 16, 2019 · 2 comments

Comments

@ArcturusZhang
Copy link
Member

I am generating api.yaml file using autorest.cli with input file: azure-rest-api-specs\specification\policyinsights\resource-manager\readme.md

Tag in use

package-2019-10.

Cli section added in readme.md

cli:
  cli-name: policyinsights
  azure-arm: true
  license-header: MICROSOFT_MIT_NO_VERSION
  namespace: azure.mgmt.policyinsights
  package-name: azure-mgmt-policyinsights
  test-scenario:
    - name: Query latest at management group scope

Problem encountered

An error is reported as follows:

ERROR: ERROR RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)
    at Object.ToSnakeCase (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\Helpers.js:8:19)
    at new ModuleOption (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\ModuleMap.js:70:38)
    at new ModuleOptionBody (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\ModuleMap.js:114:9)
    at MapGenerator.GetModelOptions (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\MapGenerator.js:518:38)
    at MapGenerator.GetModelOptions (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\MapGenerator.js:529:50)
    at MapGenerator.GetModelOptions (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\MapGenerator.js:529:50)
    at MapGenerator.GetModelOptions (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\MapGenerator.js:529:50)
    at MapGenerator.GetModelOptions (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\MapGenerator.js:529:50)
    at MapGenerator.GetModelOptions (C:\Users\dapzhang\Documents\workspace\autorest.cli\dist\Common\MapGenerator.js:529:50)

I am suspecting that the function GetModelOptions is nested to much levels.

@ArcturusZhang
Copy link
Member Author

This happens when swagger contains some recursive data types, such as trees.

@ArcturusZhang
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant