Repository navigation
Closed
Labels
bugSomething isn't working
Description
Describe the bug
While fiddling around I tried adding the machine readable file for AsyncAPI 2.0.0 as a payload and I noticed that it can be parsed fine however the template might be missing a check somewhere because it causes a RangeError: Maximum call stack size exceeded.
How to Reproduce
Place the following AsyncAPI file and the machine readable file in the same directory.
{
"asyncapi": "2.0.0",
"info": {
"title": "test",
"version": "1.0.0"
},
"channels": {
"test": {
"subscribe": {
"message": {
"payload": {
"$ref": "./2.0.0.json"
}
}
}
}
}
}
Then execute ag ./test.json @asyncapi/html-template --output ./out --install
Then you should see something similar to:
ag ./test.json @asyncapi/html-template --output ./out --install
npm http fetch GET 200 https://registry.npmjs.org/@asyncapi%2fhtml-template 17ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@asyncapi%2fgenerator-filters 143ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/openapi-sampler 44ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/markdown-it 77ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/entities 8ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/json-pointer 34ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/foreach 37ms (from cache)
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ @asyncapi/[email protected]
updated 1 package in 9.027s
60 packages are looking for funding
run `npm fund` for details
Something went wrong:
Template render error: (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\@asyncapi\html-template\template\index.html)
Template render error: (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\@asyncapi\html-template\partials\content.html)
Template render error: (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\@asyncapi\html-template\partials\operations.html)
RangeError: Maximum call stack size exceeded
at Object._prettifyError (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\lib.js:36:11)
at C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:561:19
at eval (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:118:12)
at C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:569:11
at eval (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:64:12)
at C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:569:11
at eval (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:10:11)
at C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:611:9
at eval (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:54:12)
at C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:611:9
at eval (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:21:11)
at C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:611:9
at Template.root [as rootRenderFunc] (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:42:3)
at Template.getExported (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:609:10)
at eval (eval at _compile (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:20:5)
at Environment.getTemplate (C:\Users\Lagoni\AppData\Roaming\npm\node_modules\@asyncapi\generator\node_modules\nunjucks\src\environment.js:277:9)
Versions:
npm list -g | grep @asyncapi
+-- @asyncapi/[email protected]
| +-- @asyncapi/[email protected]
| +-- @asyncapi/[email protected]
| | `-- @asyncapi/[email protected]
| +-- @asyncapi/[email protected]
| +-- @asyncapi/[email protected]
| | +-- @asyncapi/[email protected]
| +-- @asyncapi/[email protected]
Expected behavior
Should be rendered successfully.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
github-actions commentedon Sep 15, 2020
Welcome to AsyncAPI. Thanks a lot for reporting your first issue.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
derberg commentedon Sep 16, 2020
The issue is caused because
allOfissue is in our template and in generic filter that uses
openapi-sampler, probably also because ofallOfit definitely need some deeper investigation and fix will have to be pushed again to the upstream
github-actions commentedon Nov 16, 2020
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
github-actions commentedon Jan 16, 2021
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
github-actions commentedon Mar 20, 2021
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
github-actions commentedon May 22, 2021
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
github-actions commentedon Jul 24, 2021
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
magicmatatjahu commentedon Jul 26, 2021
Similar issue #165
It's related to issue in the ParserJS repo - asyncapi/parser-js#293 We need to wait for the PR in the mentioned repo.
github-actions commentedon Sep 25, 2021
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️
magicmatatjahu commentedon Sep 27, 2021
I close the issue in favour of #165