Closed neonerd closed 8 years ago
When using jsonpath, the library still uses key in body to determine whether given key exists.
key in body
return new Validator(this, key, getValue(body,key,transFn), key in body , body);
Therefore, with a body like this:
{"foo":{"bar":"hello world"}}
Following code will return an error:
this.checkBody('/foo/bar', true).first().exist()
Because the property is marked as exists:false.
exists:false
Wrote a fix in #20
Merged.
When using jsonpath, the library still uses
key in body
to determine whether given key exists.return new Validator(this, key, getValue(body,key,transFn), key in body , body);
Therefore, with a body like this:
{"foo":{"bar":"hello world"}}
Following code will return an error:
this.checkBody('/foo/bar', true).first().exist()
Because the property is marked as
exists:false
.