mirror of
https://github.com/apple/swift-http-structured-headers
synced 2026-11-30 05:18:47 +00:00
Support Decimal as well
This commit is contained in:
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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user