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.

Version 4 cyclic refs freezes without any error

See original GitHub issue

What did you do

I just upgraded to version 4 from verison 3 and tried to generate md files by running my NPM docs script:

npm run docs
# which executs: jsonschema2md -o docs/ -x docs/ -d schemas/ -e json

What did you expect to happen

All markdown files to be generated

What happened

The CLI programm freezes without any error. Last log is:

loading schemas

What’s your environment

  • Operating System: macOS Catalina 10.15.2 (19C57)
  • node.js version: v10.15.0

Do you have example files:

https://github.com/axa-ch/cyclic-schemas-test

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
trieloffcommented, Jan 7, 2020

also note: the error only occurs when writing the json again (@trieloff what is the point of this, actually?). and not when writing the markdown.

Ah, then the fix should be relatively easy. We write the JSON again so that my.schema.json my.description.md and my.1.example.json get merged into one document. The separate documents are easier to author, but the merged document is easier to consume by other tooling.

@AndyOGo a quick workaround for you might be to disable the JSON output.

@tripodsan I think our error is that the writeJsonSync function tries to serialize the proxied JSON Schema, which is recursive and gets caught up in a loop. We can circumvent this by merging the description and examples into the original (non-proxied and non-recursive) JSON and then just writing this.


The markdown processing doesn’t get caught in an endless loop, because we generate one output for each schema, and the schema identity is independent from the depth in the recursive tree.

1reaction
trieloffcommented, Dec 18, 2019

@AndyOGo the next release should have a fix. At least a fix that works with the example you’ve shared.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Circular dependency while executing cx_Freeze result
1 Answer 1 · Thanks Marcelo ! It seems to work since I don't have the error message anymore. · The answer is...
Read more >
Win2016 ReFs repository server freeze during Back-up copy
Backups and copies show messages like this: 'Unable to allocate processing resources.
Read more >
An application stops responding when a file has a circular ...
Fixes a problem in which an application stops responding when a file has a circular reference in Windows 7 or Windows Server 2008...
Read more >
Freeze or crash when opening drawings in AutoCAD products
Causes: The following are causes of this issue: Installation. AutoCAD product is not up to date. Software corruption.
Read more >
Circular Reference Warning Then Excel Crashes - Reddit
Every time I open I there is a circular reference error message, ... I've pulled up previous versions of the same file from...
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