Skip to content

Commit

Permalink
Fixing #25 and #26
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed May 24, 2023
1 parent efa6689 commit c8e3316
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Sources/PrchModel/Dictionary.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Foundation

extension Dictionary: ContentDecodable where Key: Decodable, Value: Decodable {}

extension Dictionary: ContentEncodable where Key: Encodable, Value: Encodable {}
12 changes: 10 additions & 2 deletions Sources/PrchModel/ServiceCall.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation

public protocol ServiceCall {
associatedtype SuccessType: ContentDecodable
associatedtype BodyType: ContentEncodable
associatedtype SuccessType: ContentDecodable = Empty
associatedtype BodyType: ContentEncodable = Empty
associatedtype ServiceAPI
var path: String { get }
var parameters: [String: String] { get }
Expand All @@ -14,6 +14,14 @@ public protocol ServiceCall {
}

extension ServiceCall {
var parameters: [String: String] { [:] }

var method: RequestMethod { .GET }

var headers: [String: String] { [:] }

static var requiresCredentials: Bool { false }

public func isValidStatusCode(
_ statusCode: Int
) -> Bool {
Expand Down

0 comments on commit c8e3316

Please sign in to comment.