Merge b34e0714b485ea0b79dfbd7e33938315ef2667be into 8763f33c65f7df8be5b9fe7504ab7fcf20abb41d

This commit is contained in:
Pavel Zarubin 2025-03-23 09:00:50 +08:00 committed by GitHub
commit a59b060853
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -333,7 +333,20 @@ func setWithProperType(val string, value reflect.Value, field reflect.StructFiel
case multipart.FileHeader:
return nil
}
return json.Unmarshal(bytesconv.StringToBytes(val), value.Addr().Interface())
err := json.Unmarshal(bytesconv.StringToBytes(val), value.Addr().Interface())
if err == nil {
return err
}
mv, err := json.Marshal(val)
if err != nil {
return err
}
return json.Unmarshal(mv, value.Addr().Interface())
case reflect.Map:
return json.Unmarshal(bytesconv.StringToBytes(val), value.Addr().Interface())
case reflect.Ptr: