Skip to content

对于数字类型 int uint 为什么数值是 0 时直接报 required 的信息 #302

@haodiao

Description

@haodiao

验证时已经是 map[string]any 的数组了 ,明明 key 是存在的,只是 value 是 0 的数字,怎么就无法通过 required 验证。

v := validate.Map(map[string]any{"xxx": 0})
v.StringRule("xxx", "required|uint|in:0,1,2")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions