Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

字段的校验是通过empty判断存在时才进行validator吗? #63

Open
Mr-GD opened this issue Oct 30, 2023 · 1 comment
Open
Labels

Comments

@Mr-GD
Copy link

Mr-GD commented Oct 30, 2023

现在有个场景,在参数约定remark字段为字符串,但自动化测试时remark给到了null,并没有触发string的校验,哪怕新写一个customStringValidator也不会触发:
image
image
这是service层参数打印:
image
参数校验是放controller上,说明入参字段为null时,并不会触发验证器
注:验证器继承的是:Inhere\Validate\FieldValidation

@inhere
Copy link
Owner

inhere commented Oct 30, 2023

对,不加 required 都是值不为空才进入各个验证器

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants