is-my-json-valid
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -128,3 +128,3 @@ var genobj = require('generate-object-property') | ||
var indent = 0 | ||
var error = function(msg, prop) { | ||
var error = function(msg, prop, value) { | ||
validate('errors++') | ||
@@ -134,3 +134,3 @@ if (reporter === true) { | ||
if (verbose) { | ||
validate('validate.errors.push({field:%s,message:%s,value:%s})', JSON.stringify(formatName(prop || name)), JSON.stringify(msg), name) | ||
validate('validate.errors.push({field:%s,message:%s,value:%s})', JSON.stringify(formatName(prop || name)), JSON.stringify(msg), value || name) | ||
} | ||
@@ -287,3 +287,3 @@ else { | ||
if (filter) validate('delete %s', name+'['+keys+'['+i+']]') | ||
error('has additional properties') | ||
error('has additional properties', null, '"'+name+'."+'+keys+'['+i+']') | ||
} else { | ||
@@ -290,0 +290,0 @@ visit(name+'['+keys+'['+i+']]', node.additionalProperties, reporter, filter) |
{ | ||
"name": "is-my-json-valid", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "A JSONSchema validator that uses code generation to be extremely fast", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -35,2 +35,4 @@ var tape = require('tape') | ||
additionalProperties: false | ||
}, { | ||
verbose: true | ||
}) | ||
@@ -40,2 +42,3 @@ | ||
t.notOk(validate({foo:'bar'})) | ||
t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode') | ||
t.end() | ||
@@ -42,0 +45,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96513
3088