z-schema icon indicating copy to clipboard operation
z-schema copied to clipboard

add keyword in error objects of getLastErrors()

Open futurist opened this issue 5 years ago • 0 comments

image

The error objects returned by getLastErrors() missing keyword, in above the keyword is required.

Sample code is below:

var validator = new ZSchema();
var valid = validator.validate({abc: 123}, {
    "properties": {
      "type": {
        "enum": ["common"]
      }
    },
    "required": [
      "type"
    ]
});

console.log(validator.getLastErrors());

futurist avatar Apr 01 '19 01:04 futurist