Skip to content

Commit dc91f27

Browse files
author
burak.uzunboy
committed
Now Networklayer supports Array in default
1 parent 2db08cf commit dc91f27

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Sources/UsefulNetworkLayer/NetworkLayer/APIConfiguration.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,20 @@ public protocol ResponseBodyParsable: Codable, NameDescribeable {
196196
}
197197

198198
public extension ResponseBodyParsable {
199+
init?(response: Any?) { return nil }
200+
init?(data: Data) { return nil }
199201
func cachingEndsAt() -> Date? { return nil }
200202
static var shouldUseCustomInitializer: Bool { return false }
201203
}
202204

205+
extension Array: NameDescribeable where Element: NameDescribeable {
206+
207+
}
208+
209+
extension Array: ResponseBodyParsable where Element: ResponseBodyParsable {
210+
211+
}
212+
203213
/// Response of the API if request is completed successfully.
204214
public struct APIResponse<T> where T: ResponseBodyParsable {
205215

0 commit comments

Comments
 (0)