【发布时间】:2018-02-01 18:25:40
【问题描述】:
我正在使用JOI 进行架构验证。在以下架构中,我希望 type 为 jobType.MBR 时,input_file 是必需的类型,否则 file_name 必须保持为 required 类型
const jobObjectSchema = {
type: Joi.string().valid(jobType.MBR, jobType.MP4).required(),
file_name: Joi.string().required(),
input_file: Joi.string()
};
我该怎么做?
【问题讨论】:
标签: javascript hapijs joi