From a3703a1206f252ac2f330145808e1f66f6e1ab02 Mon Sep 17 00:00:00 2001 From: Falko Buttler Date: Fri, 7 Dec 2018 17:18:31 -0800 Subject: [PATCH] Fixed CodableTransform for the case where the item is an array --- Sources/CodableTransform.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CodableTransform.swift b/Sources/CodableTransform.swift index 0308b248..117cf11d 100644 --- a/Sources/CodableTransform.swift +++ b/Sources/CodableTransform.swift @@ -56,7 +56,7 @@ open class CodableTransform: TransformType { do { let encoder = JSONEncoder() let data = try encoder.encode(item) - let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any] + let dictionary = try JSONSerialization.jsonObject(with: data, options: .allowFragments) return dictionary } catch { return nil