mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Merge pull request #3339 from McKaneAndrus/patch-json-schema
Fixed validate function
This commit is contained in:
@@ -21,10 +21,10 @@ function r(f) {
|
||||
}
|
||||
|
||||
function validate(file, instance, schema) {
|
||||
var result = jsonschema.validate(instance, schema);
|
||||
if (result.length) {
|
||||
var validationErrors = jsonschema.validate(instance, schema).errors;
|
||||
if (validationErrors.length) {
|
||||
console.error(file + ": ");
|
||||
result.forEach(function(error) {
|
||||
validationErrors.forEach(function(error) {
|
||||
if (error.property) {
|
||||
console.error(error.property + ' ' + error.message);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user