+0
Daily
5,810
stars
1,060
forks
215
watchers
196
prs
655
issues
41
releases
README
Deprecation notice
This repo is no longer maintained (see also https://github.com/jdorn/json-editor/issues/800)
Development is continued at https://github.com/json-editor/json-editor
For details please visit https://github.com/json-editor/json-editor/issues/5
---
JSON Editor
===========
!JSON Schema - HTML Editor - JSON
JSON Editor takes a JSON Schema and uses it to generate an HTML form.
It has full support for JSON Schema version 3 and 4 and can integrate with several popular CSS frameworks (bootstrap, foundation, and jQueryUI).
Check out an interactive demo (demo.html): http://jeremydorn.com/json-editor/
Download the [production version][min] (22K when gzipped) or the [development version][max].
[min]: https://raw.github.com/jdorn/json-editor/master/dist/jsoneditor.min.js
[max]: https://raw.github.com/jdorn/json-editor/master/dist/jsoneditor.js
Requirements
-----------------
JSON Editor has no dependencies. It only needs a modern browser (tested in Chrome and Firefox).
Optional Requirements
The following are not required, but can improve the style and usability of JSON Editor when present.
A compatible JS template engine (Mustache, Underscore, Hogan, Handlebars, Swig, Markup, or EJS)
A compatible CSS framework for styling (bootstrap 2/3, foundation 3/4/5, or jqueryui)
A compatible icon library (bootstrap 2/3 glyphicons, foundation icons 2/3, jqueryui, or font awesome 3/4)
SCEditor for WYSIWYG editing of HTML or BBCode content
EpicEditor for editing of Markdown content
Ace Editor for editing code
Select2 for nicer Select boxes
Selectize for nicer Select & Array boxes
math.js for more accurate floating point math (multipleOf, divisibleBy, etc.)
Usage
--------------
If you learn best by example, check these out:
Basic Usage Example - http://rawgithub.com/jdorn/json-editor/master/examples/basic.html
Advanced Usage Example - http://rawgithub.com/jdorn/json-editor/master/examples/advanced.html
CSS Integration Example - http://rawgithub.com/jdorn/json-editor/master/examples/css_integration.html
The rest of this README contains detailed documentation about every aspect of JSON Editor. For more under-the-hood documentation, check the wiki.
Initialize
js
var element = document.getElementById('editor_holder');
var editor = new JSONEditor(element, options);
Options
Options can be set globally or on a per-instance basis during instantiation.
js
// Set an option globally
JSONEditor.defaults.options.theme = 'bootstrap2';
// Set an option during instantiation
var editor = new JSONEditor(element, {
//...
theme: 'bootstrap2'
});
Here are all the available options:
Option
Description
Default Value
ajax
If true, JSON Editor will load external URLs in $ref via ajax.
false
disable_array_add
If true, remove all "add row" buttons from arrays.
false
disable_array_delete
If true, remove all "delete row" buttons from arrays.
falsTop issues
#315conditional show/hide of group fields20 comments · 2014-12-11#156Allowing "format" designations via JSONPath expressions15 comments · 2014-06-27#358Grid layout not working for me11 comments · 2015-02-27#272Label not linked to input11 comments · 2014-11-03#432Constant values for enumSource broken10 comments · 2015-06-15#389Uncaught TypeError: Cannot read property 'required' of undefined at line 438110 comments · 2015-05-12#729Validation for each field is not working when use anyOf9 comments · 2017-02-22#398Problem with "oneOf"9 comments · 2015-05-15
Latest release
JSON Editor 0.7.28 v0.7.28 2016-08-07Changelog - Add support for enum_titles with mutliselect editor - Bug fix: array add-remove-add deleted non-required properties - Bug fix: this.translate not a function