📜  Joi.validate - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:06.879000             🧑  作者: Mango

代码示例5
function responseValidate(response) {
  const schema = {
    id: Joi.objectId().required(),
    response: Joi.string().min(3).max(512).required()
  };

  return schema.validate(response);
}