Open J1angyue opened 1 year ago
Same issue
@jswxwxf @J1angyue 我这边写是没问题的,试试参考这个最小实现,https://stackblitz.com/edit/typescript-7dtq2r?file=nest.ts
请问是否支持 这样的嵌套path定义?
const rules = {
'a.b.c': [
{ required: true, message: 'a.b.c is required' },
{ type: 'string', message: 'a.b.c must be a string' },
],
};
const data = {
a: {
b: {
c: '123'
}
}
}
比如有以下对象,要验证c属性:
{ a: { b: { c: 'ccc' } } }
规则是这样写吗?不生效啊a: { type: 'object', required: true, fields: { b: { type: 'object', required: true, fields: { c: { type: 'string', required: true } } } } }