Open dex80526 opened 3 years ago
The following struct:
type S struct { Props map[string]interface{} `valid:"required"` } d := S{props: map[string]interface{}{"field": "test"} result, err := valid.ValidateStruct(d) ...
With the above code, it gets an error: "function only accepts structs; got string;"
The validator does not handle required field of map[string]interface{} correctly.
The current result: false with the error msg of "function only accepts structs; got string;"
See the above sample code.
The expected validation result: true (no error)
Bug Report
The following struct:
With the above code, it gets an error: "function only accepts structs; got string;"
Summary
The validator does not handle required field of map[string]interface{} correctly.
Current behavior
The current result: false with the error msg of "function only accepts structs; got string;"
How to reproduce
See the above sample code.
Expected behavior
The expected validation result: true (no error)