We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the Question
how to use vd in hz |如何使用校验相关参数在hz命令行中 Reproducible Code
vd 相关文档过于简单了,我尝试了很多次,才成功生成想要的代码 另外vd 相关限制也很痛苦,比如 string password = 2 [(api.go_tag)='json:"password,required"',(api.vd)="len($)>=8 && len($)<=16; msg:'length must between 8 to 16 | 密码长度需要在8-16之间'"]; msg 部分如果单引号合双引号互换就会无法生成对的代码。
string password = 2 [(api.go_tag)='json:"password,required"',(api.vd)="len($)>=8 && len($)<=16; msg:'length must between 8 to 16 | 密码长度需要在8-16之间'"];
没有复杂使用的例子导致只能靠尝试或者猜测来编写
The text was updated successfully, but these errors were encountered:
你需要添加或补充哪些相关内容? 我可以补充下,不过 Validator 这个主要使用了一个开源库,所以具体的语法可以参看该库
Sorry, something went wrong.
辛苦您了,感觉应该添加一些复杂使用示例,比如使用正则加运算符表达式,同时自定义错误提示消息。 我在处理这部分的过程中,需要不停翻阅开源库与hz两边的文档及代码。还是很痛苦的。我感觉其他开发者可能也会有相同的问题
没问题的,我可以加一些基本的使用示例,高级用法可以去查阅原库。
十分感谢🙏
cc @chaoranz758
No branches or pull requests
Describe the Question
how to use vd in hz |如何使用校验相关参数在hz命令行中
Reproducible Code
vd 相关文档过于简单了,我尝试了很多次,才成功生成想要的代码
另外vd 相关限制也很痛苦,比如
string password = 2 [(api.go_tag)='json:"password,required"',(api.vd)="len($)>=8 && len($)<=16; msg:'length must between 8 to 16 | 密码长度需要在8-16之间'"];
msg 部分如果单引号合双引号互换就会无法生成对的代码。
没有复杂使用的例子导致只能靠尝试或者猜测来编写
The text was updated successfully, but these errors were encountered: