Support Decimal as well

This commit is contained in:
Cory Benfield committed 2020-07-16 17:28:47 +01:00
1 parent e12def54da
commit 141f102bd0
11 files changed
+161 -4

No files matched your search

@@ -102,6 +102,9 @@ extension StructuredFieldDecoder {
if type is Data.Type {
let container = try decoder.singleValueContainer()
return try container.decode(Data.self) as! StructuredField
} else if type is Decimal.Type {
let container = try decoder.singleValueContainer()
return try container.decode(Decimal.self) as! StructuredField
} else {
return try type.init(from: decoder)
}