Apologies if this has already been ask, but I wasn't able able to find an answer that works
I am having trouble validating a JSON Schema using an enum type with AVJ
I would expect the below code to return false, since the given value does not appear in the enum type
var Ajv = require('ajv');
var ajv = new Ajv();
var schema = {
gender: {
enum: [
'male',
'female',
'other'
]
}
};
ajv.validate(schema, { gender: 'test' });
// returns true
Are you able to let me know how to fix this please