mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-26 19:11:08 +01:00
fix(serialization): correct validation parameter
- Fix bug in mapUnmarshalValidate where checkValidateTag parameter was incorrectly negated when passed to Convert() - Remove obsolete validateWithValidator helper function
This commit is contained in:
@@ -315,7 +315,7 @@ func mapUnmarshalValidate(src SerializedObject, dstV reflect.Value, checkValidat
|
||||
info := getTypeInfo(dstT)
|
||||
for k, v := range src {
|
||||
if field, ok := info.getField(dstV, k); ok {
|
||||
err := Convert(reflect.ValueOf(v), field, !info.hasValidateTag)
|
||||
err := Convert(reflect.ValueOf(v), field, checkValidateTag)
|
||||
if err != nil {
|
||||
errs.Add(err.Subject(k))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user