Describe the bug
The JsonEditor component, used throughout the documentation to display interactive JSON Schema examples, fails to provide documentation links and correct syntax highlighting for subschemas defined under several critical keywords.
Currently, the editor only recognizes subschemas within properties, patternProperties, and items. Keywords like $defs, definitions, allOf, anyOf, oneOf, not, if, then, and else are treated as regular data, meaning their contents are not interactive and do not link to the reference documentation.
Steps To Reproduce
1.) Run the website locally using yarn dev.
2.) Navigate to the Structuring page: http://localhost:3000/understanding-json-schema/structuring#defs
3.) Scroll down to the $defs section.
4.) Hover over or click keywords like "type", "string", or "items" inside the $defs code block.
5.) Observe: They are rendered in cyan (data style) and are not clickable.
6.) Compare this to the Basics section: http://localhost:3000/understanding-json-schema/basics, where the same keywords inside a properties block are light blue and link to the docs.
Expected Behavior
The editor should recursively identify subschemas within all valid JSON Schema keywords. Specifically, getScopesOfParsedJsonSchema.ts
needs to be updated to traverse:
Object maps of schemas: $defs, definitions, dependentSchemas.
Arrays of schemas: allOf, anyOf, oneOf.
Single subschemas: not, if, then, else, additionalProperties.
Screenshots
Expected:-
Actual :-
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
Yes
Describe the bug
The JsonEditor component, used throughout the documentation to display interactive JSON Schema examples, fails to provide documentation links and correct syntax highlighting for subschemas defined under several critical keywords.
Currently, the editor only recognizes subschemas within properties, patternProperties, and items. Keywords like $defs, definitions, allOf, anyOf, oneOf, not, if, then, and else are treated as regular data, meaning their contents are not interactive and do not link to the reference documentation.
Steps To Reproduce
1.) Run the website locally using yarn dev.
2.) Navigate to the Structuring page: http://localhost:3000/understanding-json-schema/structuring#defs
3.) Scroll down to the $defs section.
4.) Hover over or click keywords like "type", "string", or "items" inside the $defs code block.
5.) Observe: They are rendered in cyan (data style) and are not clickable.
6.) Compare this to the Basics section: http://localhost:3000/understanding-json-schema/basics, where the same keywords inside a properties block are light blue and link to the docs.
Expected Behavior
The editor should recursively identify subschemas within all valid JSON Schema keywords. Specifically, getScopesOfParsedJsonSchema.ts
needs to be updated to traverse:
Object maps of schemas: $defs, definitions, dependentSchemas.
Arrays of schemas: allOf, anyOf, oneOf.
Single subschemas: not, if, then, else, additionalProperties.
Screenshots
Expected:-
Actual :-
Device Information [optional]
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
Yes