Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Maximum call stack size exceeded when swagger.yaml spec contains circular $ref #129

Open
ouadi opened this issue May 24, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@ouadi
Copy link

ouadi commented May 24, 2018

Expected Behavior

swagger_ui and swagger_to_html should render a Swagger spec that contains circular $ref.

Actual Behavior

hexo generate or hexo server crash and show the following error:

INFO  Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path)
  RangeError: Maximum call stack size exceeded
    at Object._prettifyError (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/nunjucks/src/lib.js:36:11)
    at /home/yo/tmp/experiment-hexo/ozd-docs/node_modules/nunjucks/src/environment.js:545:19
    at eval (eval at _compile (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/nunjucks/src/environment.js:615:18), <anonymous>:9:11)
    at tryCatcher (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/yo/tmp/experiment-hexo/ozd-docs/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)

The issue is at the level of swagger-ui and is known (see UI crashes when the definitions contain circular references). It has been already fixed.

The question is: how to force hexo-theme-doc to use the fixed version of swagger-ui?

Steps to Reproduce the Problem

  1. have a swagger spec with circular $ref
  2. have a source file that uses swagger_ui tag or swagger_to_html tag
  3. execute hexo generate or hexo s

Specifications

  • NodeJS Version: 6.9.2
  • NPM Version: 3.10.9
  • OS: Ubuntu 14.04
  • Hexo Version: 3.7.1
@rbarilani
Copy link
Contributor

@ouadi There isn't way "to force" to use a specific version of swagger_ui at the moment, plus we have to investigate if that's really just a problem of "swagger-ui" or it happens when we parse the spec....

@rbarilani rbarilani added this to the 1.1.0 milestone May 24, 2018
@rbarilani rbarilani added the bug label May 24, 2018
@ouadi
Copy link
Author

ouadi commented May 29, 2018

Will it be possible to suggest a work-around for the time being? With this issue, my very first use of hexo-theme-doc to document an API is completely blocked.
I highly appreciate you help.

@bhaskarmelkani
Copy link
Contributor

bhaskarmelkani commented May 30, 2018

Hey,

Sincere apologies for a delayed response.
Since the issue with swagger-ui is already fixed and we are using relaxed versioning(^) for it so you should get the update without any change.
I am also updating the version of swagger-ui to the latest version.
For swagger-to-html, I will fix the issue but it might take some time.

@ouadi
Copy link
Author

ouadi commented May 30, 2018

Many thanks for your valuable help and involvement.
I will wait for the fix.

This was referenced May 30, 2018
@ghost
Copy link

ghost commented Aug 9, 2019

@ghost
Copy link

ghost commented Aug 15, 2019

@ALL - Any updates on this please ?

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

No branches or pull requests

3 participants