You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a problem when you convert Realm objects using toDictionary(). When given realm object has nested array it uses toCodableValue() method from RealmListEVCustomReflectable.swift. There're conversion of every item in nested array to dictionary in this method:
public func toCodableValue() -> Any {
var q:[Any] = []
for case let e as Any in self {
q.append((e as? EVReflectable)?.toDictionary([.PropertyConverter, .KeyCleanup, .PropertyMapping, .DefaultSerialize]) ?? e)
}
return q
// Why do we need all this code? Should be the same as this. But this crashes.
//return self.enumerated().map { ($0.element as? EVReflectable)?.toDictionary() ?? NSDictionary() }
}
The problem here is in conversion options: [.PropertyConverter, .KeyCleanup, .PropertyMapping, .DefaultSerialize]. This converts properties of items in nested array when you use .KeyCleanup
Can you look up this issue somehow? E.g. use conversionOptions passed from above in method toCodableValue() or just remove this hard-coded options?
Thnx for attention.
The text was updated successfully, but these errors were encountered:
There is a problem when you convert Realm objects using
toDictionary()
. When given realm object has nested array it usestoCodableValue()
method from RealmListEVCustomReflectable.swift. There're conversion of every item in nested array to dictionary in this method:The problem here is in conversion options:
[.PropertyConverter, .KeyCleanup, .PropertyMapping, .DefaultSerialize]
. This converts properties of items in nested array when you use.KeyCleanup
I've got object like this in my case :
And after conversion I've got this dictionary with unexpected properties in array items:
Can you look up this issue somehow? E.g. use
conversionOptions
passed from above in methodtoCodableValue()
or just remove this hard-coded options?Thnx for attention.
The text was updated successfully, but these errors were encountered: