Description#
The jsoneditor shortcode allows to display a form based on a JSON Schema. This form can then be used to export (copy to clipboard/download as a file) the resulting JSON.
Parameters#
Name | Type(named/positional) | Description |
---|---|---|
source | named | Source of the JSON Schema. NB: The source can be either a local path or an URL. |
postAnalyzeFunction | named | Name of the global Javascript method to run specific and additionnal validation right after the Jsoneditor standard validation.
|
postProcessFunction | named | Name of the global Javascript method to run specific and additionnal process right after the Jsoneditor standard JSON generation.
|
filenameToDownloadFunction | named | Name of the global Javascript method to define filename to download.
NB: By default filename will be equal to schema.title or fallback to the ID of the jsoneditor HTML container. |
// Function to run additionnal process after standard JSON Schema validation in jsoneditor
window.examplePostAnalyzeFunction = function examplePostAnalyzeFunction(schema, json) {
return [{path: 'root.dummy', message: 'A dummy error'}]
}
// Function to run additionnal process after standard JSON process in jsoneditor
window.examplePostProcessFunction = function examplePostProcessFunction(schema, json) {
return 'An example post process JSON'
}
// Function to define filename to download
window.exampleFilenameToDownloadFunction = function exampleFilenameToDownloadFunction(schema, json) {
return 'exampleFile.json'
}
Examples#
Markdown | Rendering |
---|---|
| |
| |
| |
| |
|