nswbmw / another-json-schema

Another JSON Schema validator, simple & flexible & intuitive.
48 stars 8 forks source link

The option required: true doesn't work #5

Closed peerapats closed 7 years ago

peerapats commented 7 years ago

I have tested with following code, it always pass validation.

const Schema = require('another-json-schema');

const schema = Schema({
  os: { type: 'string', enum: ['ios', 'android'] },
  name: { type: 'string', required: true },
});

let phone = {
  os: 'ios',
};

console.log(schema.validate(phone));
nswbmw commented 7 years ago

No required: true option provided.

nswbmw commented 7 years ago

v3.0.0 support required: true