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
Data validation-validation rules-confusing required-if #3441
Labels
Comments
Issues-translate-bot
changed the title
数据校验-校验规则-令人迷惑的required-if
Data validation-validation rules-confusing required-if
Mar 31, 2024
I make a pr 3455, please have a look. |
gqcn
added
enhancement
help wanted
planned
This issue/proposal is planned into our next steps.
and removed
question
labels
Apr 7, 2024
Hello @cococolanosugar. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it! |
@cococolanosugar It seems that the comments of the function is incorrect. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
required-if的困惑
关于required-if校验规则:
中文文档中说明为:
必需参数(当任意所给定字段值与所给值相等时,即:当field字段的值为value时,当前验证字段为必须参数)。多个字段以,号分隔。
而其英文注释为:
Required unless all given field and its value are equal.
而其代码实现为:
综合看起来,代码实现跟中文说明相符,而与英文注释不符。
同理required-unless也有相应confuse!
建议:
将required-if拆分为多个更易于理解的规则,例如:
required-if-all-eq: 如果所有条件符合,则该字段必须;
required-if-any-eq: 如果任一条件符合,则该字段必须;
The text was updated successfully, but these errors were encountered: