Skip to content

Commit

Permalink
Fixed josdejong#283: improved JSON schema error message in case of no
Browse files Browse the repository at this point in the history
  additionalProperties
  • Loading branch information
josdejong committed Mar 24, 2016
1 parent aeca444 commit f0afcea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 4 additions & 0 deletions src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,10 @@ exports.improveSchemaError = function (error) {
}
}

if (error.keyword === 'additionalProperties') {
error.message = 'should NOT have additional property: ' + error.params.additionalProperty;
}

return error;
};

Expand Down

0 comments on commit f0afcea

Please sign in to comment.