-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
EasySwoole\HttpAnnotation\AnnotationController
line(250), 校验的参数被赋值默认null. 导致required
不生效, 只能使用notEmpty
- 以下注解验证必填未生效
@Param(name="name",required="",lengthMin="2",lengthMax="25",alias="姓名")
//未传递name参数, 验证结果如下(必填验证未生效):
// {"code":400,"result":null,"msg":"姓名长度不能超过25"}
提取校验规则顺序是通过EasySwoole\HttpAnnotation\AnnotationTag\Param->allowValidateRule
固定顺序进行遍历提取, 不能按照注解的规则顺序进行校验
- 以下注解验证顺序不对应
@Param(name="url",notEmpty="",url="",lengthMin="5",lengthMax="120",alias="链接地址")
//传递url值为 xx, , 验证结果如下(应当先进行url合法性验证):
{"code":400,"result":null,"msg":"链接地址长度不能小于5"}
Metadata
Metadata
Assignees
Labels
No labels