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

Stuck in "generating markdown" step - potential performance issue #251

Open
kevindra opened this issue Sep 21, 2020 · 0 comments
Open

Stuck in "generating markdown" step - potential performance issue #251

kevindra opened this issue Sep 21, 2020 · 0 comments
Labels

Comments

@kevindra
Copy link

What did you do

I have 3 json schema files - A.json, B.json, C.json. A references B and B references C. However, when I run the jsonschema2md command, command gets stuck at the gererating markdown step.

$ jsonschema2md -d . -e json --out ../out
loading 3 schemas
writing schemas
writing schemas to ...
writing README
building readme
writing documentation
generating markdown // stuck here

In my research so far, it seems like this happens when there are too many incoming references to a definition and/or when an array based reference references another array based reference.

Please see the example below of all 3 files, I deliberately added few extra properties extends[n] to the A.json schema, which made the command got stuck. Please help.

What did you expect to happen

Markdown to generate successfully.

What happened

Command got stuck at generating markdown step

What's your environment

  • Operating System: macOs High Sierra 10.13.6
  • node.js version: v14.3.0

Do you have example files:

A.json

{
    "$id": "https://foo.bar/A",
    "$schema": "http://json-schema.org/draft-07/schema#",

    "type": "object",

    "properties": {
        "extends": {
            "type": "array",
            "items": {
                "$ref": "https://foo.bar/B"
            }
        },
        "extends2": {
            "type": "array",
            "items": {
                "$ref": "https://foo.bar/B"
            }
        },
        "extends3": {
            "type": "array",
            "items": {
                "$ref": "https://foo.bar/B"
            }
        },
        "extends4": {
            "type": "array",
            "items": {
                "$ref": "https://foo.bar/B"
            }
        },
        "extends5": {
            "type": "array",
            "items": {
                "$ref": "https://foo.bar/B"
            }
        }
    }
}

B.json

{
    "$id": "https://foo.bar/B",
    "$schema": "http://json-schema.org/draft-07/schema#",
    
    "type": "array",
    "items": {
        "$ref": "https://foo.bar/C"
    }
}

C.json

{
    "$id": "https://foo.bar/C",
    "$schema": "http://json-schema.org/draft-07/schema#",

    "type": "string"
}
@trieloff trieloff added the bug label Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants