Closed sidraval closed 5 years ago
https://github.com/thoughtbot/Swish/issues/125
When a Request's ResponseObject was declared to be Optional<T> where T: Decodable, Swish would erroneously produce a, DecodingError if the HTTP response had empty body data.
Request
ResponseObject
Optional<T>
T: Decodable
DecodingError
This commit specializes the default parse implementation into two variants:
parse
typealias ResponseObject = T?
typealias ResponseObject = T
https://github.com/thoughtbot/Swish/issues/125
When a
Request
'sResponseObject
was declared to beOptional<T>
whereT: Decodable
, Swish would erroneously produce a,DecodingError
if the HTTP response had empty body data.This commit specializes the default
parse
implementation into two variants:typealias ResponseObject = T?
typealias ResponseObject = T