jdorn / json-editor

JSON Schema Based Editor
MIT License
5.8k stars 1.08k forks source link

how to add or modify description on json schema #829

Closed jackson19921109 closed 4 years ago

jackson19921109 commented 5 years ago

if i want to add or modify description on json schema , and i don't want to change it on the json schema string , I just want to do it on the html form page, is there any api to do this ?

john-nance commented 5 years ago

Just set the title property to the value you want to see in the form

"propertyName": {
                type: "string",
                title: "Friendly name"
} 
Houfeng commented 5 years ago

Try using sditor : https://github.com/Houfeng/sditor

pmk65 commented 5 years ago

if i want to add or modify description on json schema , and i don't want to change it on the json schema string , I just want to do it on the html form page, is there any api to do this ?

@jackson19921109 Dunno if it works with this version of the library, but it works using the updated version available at: https://github.com/json-editor/json-editor

Example of changing label and description at runtime: https://is.gd/ktVrQQ (Label and description of 1st element is changed after form is ready.)