diff --git a/HISTORY.md b/HISTORY.md index c45e298..f8e2fdf 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,12 @@ https://github.com/josdejong/jsoneditor +## not yet released, version 5.2.1 + +- Fixed #283: improved JSON schema error message in case of no + additionalProperties. + + ## 2016-03-20, version 5.2.0 - Implemented method `editor.destroy()` to properly cleanup the editor (#278). diff --git a/src/js/util.js b/src/js/util.js index f760294..c7c8fa7 100644 --- a/src/js/util.js +++ b/src/js/util.js @@ -690,6 +690,10 @@ exports.improveSchemaError = function (error) { } } + if (error.keyword === 'additionalProperties') { + error.message = 'should NOT have additional property: ' + error.params.additionalProperty; + } + return error; };