Merge b34e0714b485ea0b79dfbd7e33938315ef2667be into 77d70e5858278193abfab732164b0c1415d8d4ba

This commit is contained in:
Pavel Zarubin 2025-06-12 14:21:48 -04:00 committed by GitHub
commit 70f7172834
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: