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

Information missing in circular refs #165

Open
gerrycampion opened this issue Oct 5, 2022 · 3 comments
Open

Information missing in circular refs #165

gerrycampion opened this issue Oct 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@gerrycampion
Copy link

Here is an example json schema with a circular ref:

{
  "$defs": {
    "node": {
      "oneOf": [
        {
          "$ref": "#/$defs/internal"
        },
        {
          "const": "I am a leaf"
        }
      ]
    },
    "internal": {
      "items": [
        {
          "$ref": "#/$defs/node"
        }
      ],
      "type": "array"
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "Node": {
      "$ref": "#/$defs/node"
    }
  },
  "type": "object"
}

I generate the schema html using js template and no other options.
When I generate the schema html, I don't see any information about the original anchor node that is referenced. Note for example, there is no way to see the "I am a leaf" const. Here is a screenshot of the fully expanded html doc:

image

The generated html

@dblanchette dblanchette added the bug Something isn't working label Nov 8, 2022
@mrutkows
Copy link

mrutkows commented May 3, 2023

Very interested in this fix as we are unable to visualize any more recent JSON schemas where this practice is quite common when dealing with large schemas that reuse definitions for simplification and extensibility.

@arghness
Copy link

Also interested in this. I've been subscribed to the bug for about a year. I've tried setting link_to_reused_ref=true, but still no success. Are there any alternative JSON schema documentation generators that can handle it, while still producing reasonably navigable output?

@gerrycampion
Copy link
Author

@arghness
atlassian-labs json-schema-viewer seemed like a solid contender, but didn't support const last time I checked:
atlassian-labs/json-schema-viewer#38
That was also a dealbreaker, so I've given up for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants