我有一个有效载荷样本
{
{
'a':"hi"
},
{
'bhi':"add b in the begining and value of 'a' which will be key name"
'name':'string schema may include with pattern /name.*/',
'age':'number schema may include with pattern /age.*/'
}
}
我已经这样写了验证:
var aObject=Joi.object(
a:Joi.string()
);
var bObject=Joi.object(
['b'+aObject.a]:Joi.string()
).pattern(/name.*/,Joi.string());
Joi.object(aobjectkey:aObject,bobjectkey:bObject);
我无法像这样进行验证。我缺少其他验证年龄的方法。我该如何进行验证?请帮帮我。