From a2b84b2dd84a76bcad431ef720d217c40bc5c222 Mon Sep 17 00:00:00 2001 From: jos Date: Tue, 12 Jan 2016 12:40:23 +0100 Subject: [PATCH] Updated readme, docs, added example --- README.md | 10 ++- docs/api.md | 114 +++++++++++++++++------- examples/01_basic_usage.html | 3 +- examples/07_json_schema_validation.html | 67 ++++++++++++++ test/test_schema.html | 4 +- 5 files changed, 159 insertions(+), 39 deletions(-) create mode 100644 examples/07_json_schema_validation.html diff --git a/README.md b/README.md index 8aa4792..039dd3e 100644 --- a/README.md +++ b/README.md @@ -26,13 +26,14 @@ Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 9+. - Change type of values. - Sort arrays and objects. - Colorized code. -- Search & highlight text in the treeview. +- Search & highlight text in the tree view. - Undo and redo all actions. +- JSON schema validation (powered by [ajv](https://github.com/epoberezkin/ajv)). ### Code editor - Format and compact JSON. -- Colorized code (powered by Ace). -- Inspect JSON (powered by Ace). +- Colorized code (powered by [Ace](https://ace.c9.io)). +- Inspect JSON (powered by [Ace](https://ace.c9.io)). ### Text editor - Format and compact JSON. @@ -85,7 +86,8 @@ There is a directive available for using JSONEditor in Angular.js: + + + + +

JSON schema validation

+

+ This example demonstrates JSON schema validation. The JSON object in this example must contain properties firstName and lastName, can can optionally have a property age which must be a positive integer. +

+

+ See http://json-schema.org/ for more information. +

+ +
+ + + + diff --git a/test/test_schema.html b/test/test_schema.html index cfa80af..a8d95b9 100644 --- a/test/test_schema.html +++ b/test/test_schema.html @@ -64,8 +64,8 @@ }; var options = { - mode: 'tree', - modes: ['form', 'tree', 'view'], // allowed modes + mode: 'text', + modes: ['text', 'form', 'tree', 'view'], // allowed modes onError: function (err) { console.error(err); },