json-schema-for-humans
json-schema-for-humans copied to clipboard
Information missing in circular refs
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:
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.
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?
@arghness
atlassian-labs json-schema-viewer seemed like a solid contender, but didn't support const
last time I checked:
https://github.com/atlassian-labs/json-schema-viewer/issues/38
That was also a dealbreaker, so I've given up for now.