Hello! When using JSONEncoder, dictionary types that are optional are not correctly encoded by Skip.
struct TestEntity2: Codable {
let optionalDict: [String: String]?
let nonOptionalDict: [String: String]
}
// This succeeds ✅
try! JSONEncoder().encode(TestEntity2(optionalDict: nil, nonOptionalDict: [:]))
// This fails ❌ data error skip.lib.ErrorException: java.lang.ClassCastException: skip.lib.Tuple2 cannot be cast to skip.lib.Encodable
try! JSONEncoder().encode(TestEntity2(optionalDict: ["1": "abc"], nonOptionalDict: ["1": "abc"]))
I'm currently working around by using a non optional dict and making it empty to represent nil.
Thank you!
Hello! When using
JSONEncoder, dictionary types that are optional are not correctly encoded by Skip.I'm currently working around by using a non optional dict and making it empty to represent nil.
Thank you!