Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

joi enum validation

const schema = Joi.object().keys({
  type: Joi.string().valid('ios', 'android'),
});

const myObj = { type: 'none' };
const result = Joi.validate(myObj, schema);
console.log(result);
 
PREVIOUS NEXT
Tagged: #joi #enum #validation
ADD COMMENT
Topic
Name
4+1 =