thoughtbot / Swish

Nothing but Net(working)
MIT License
363 stars 39 forks source link

Fix a bug where optional ResponseObject types produced an error #126

Closed sidraval closed 5 years ago

sidraval commented 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.

This commit specializes the default parse implementation into two variants: