📜  Joi 验证 - Javascript 代码示例

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

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

  return schema.validate(response);
}