Open andreyqin opened 3 weeks ago
Hi! I'm implementing a JSON editor and I want the user to get some hints when hovering on a field inside the editor. The issue is that if I have a tree schema structure like below:
const schema = { type: 'object', properties: { props: { type: 'array', items: { type: 'string', enum: ['a', 'b', 'c'], }, description: 'This is props field', }, children: { type: 'array', items: { $ref: '#' }, description: 'This is children field', }, }, };
getHoverTexts only receives the schema's description for fields on first level of nesting:
getHoverTexts
description
{ "props": ["a"], "children": [ { "props": ["b"] } ] }
So when hovering on first props, getHoverTexts's callback receives the following schema:
props
getHoverTexts's
{ "type": "array", "items": { "type": "string", "enum": [ "a", "b", "c" ] }, "description": "This is props field" }
So I get the description and can show it to the end user. But when I'm hovering on the nesting props, I get:
{ "type": "array", "items": { "type": "string" } }
And as you can see, the description is missing in this case.
I'm using: node v18.7.0, "codemirror-json-schema": "^0.7.8", "@codemirror/lang-json": "^6.0.1", "@uiw/react-codemirror": "^4.22.1".
Hi! I'm implementing a JSON editor and I want the user to get some hints when hovering on a field inside the editor. The issue is that if I have a tree schema structure like below:
getHoverTexts
only receives the schema'sdescription
for fields on first level of nesting:So when hovering on first
props
,getHoverTexts's
callback receives the following schema:So I get the
description
and can show it to the end user. But when I'm hovering on the nestingprops
, I get:And as you can see, the description is missing in this case.
I'm using: node v18.7.0, "codemirror-json-schema": "^0.7.8", "@codemirror/lang-json": "^6.0.1", "@uiw/react-codemirror": "^4.22.1".