Updated the type of the "body" property in the Endpoint protocol to the Data type from Foundation.
This commit is contained in:
parent
01742cc4c6
commit
01d060d583
@ -6,12 +6,14 @@
|
||||
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct DeleteItemEndpoint: Endpoint {
|
||||
let path: String
|
||||
let method: RequestMethod
|
||||
let credentials: BasicCredentials
|
||||
let headers: [String : String]
|
||||
let body: [String : String]?
|
||||
let body: Data?
|
||||
}
|
||||
|
||||
// MARK: - Initialisers
|
||||
|
@ -6,12 +6,14 @@
|
||||
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct GetDataEndpoint: Endpoint {
|
||||
let path: String
|
||||
let method: RequestMethod
|
||||
let credentials: BasicCredentials
|
||||
let headers: [String : String]
|
||||
let body: [String : String]?
|
||||
let body: Data?
|
||||
}
|
||||
|
||||
// MARK: - Initialisers
|
||||
|
@ -6,12 +6,14 @@
|
||||
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct GetItemsEndpoint: Endpoint {
|
||||
let path: String
|
||||
let method: RequestMethod
|
||||
let credentials: BasicCredentials
|
||||
let headers: [String : String]
|
||||
let body: [String : String]?
|
||||
let body: Data?
|
||||
}
|
||||
|
||||
// MARK: - Initialisers
|
||||
|
@ -6,12 +6,14 @@
|
||||
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct GetMeEndpoint: Endpoint {
|
||||
let path: String
|
||||
let method: RequestMethod
|
||||
let credentials: BasicCredentials
|
||||
let headers: [String : String]
|
||||
let body: [String : String]?
|
||||
let body: Data?
|
||||
}
|
||||
|
||||
// MARK: - Initialisers
|
||||
|
@ -6,6 +6,8 @@
|
||||
// Copyright © 2022 Röck+Cöde. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol Endpoint {
|
||||
var scheme: String { get }
|
||||
var host: String { get }
|
||||
@ -13,7 +15,7 @@ protocol Endpoint {
|
||||
var method: RequestMethod { get }
|
||||
var credentials: BasicCredentials { get }
|
||||
var headers: [String: String] { get }
|
||||
var body: [String: String]? { get }
|
||||
var body: Data? { get }
|
||||
}
|
||||
|
||||
// MARK: - Defaults
|
||||
|
@ -47,7 +47,7 @@ final class DeleteItemEndpoint_InitTests: XCTestCase {
|
||||
XCTAssertNil(endpoint.body)
|
||||
}
|
||||
|
||||
func test_withItemId_andEmptyUsernameOrPassword() async throws {
|
||||
func test_withItemId_andEmptyUsernameOrPassword() throws {
|
||||
// GIVEN
|
||||
username = ""
|
||||
password = "password"
|
||||
|
@ -47,7 +47,7 @@ final class GetDataEndpointInitTests: XCTestCase {
|
||||
XCTAssertNil(endpoint.body)
|
||||
}
|
||||
|
||||
func test_withItemId_andEmptyUsernameOrPassword() async throws {
|
||||
func test_withItemId_andEmptyUsernameOrPassword() throws {
|
||||
// GIVEN
|
||||
username = ""
|
||||
password = "password"
|
||||
|
@ -47,7 +47,7 @@ final class GetItemsEndpointInitTests: XCTestCase {
|
||||
XCTAssertNil(endpoint.body)
|
||||
}
|
||||
|
||||
func test_withItemId_andEmptyUsernameOrPassword() async throws {
|
||||
func test_withItemId_andEmptyUsernameOrPassword() throws {
|
||||
// GIVEN
|
||||
username = ""
|
||||
password = "password"
|
||||
|
@ -40,7 +40,7 @@ final class GetMeEndpointInitTests: XCTestCase {
|
||||
XCTAssertNil(endpoint.body)
|
||||
}
|
||||
|
||||
func test_withEmptyUsernameOrPassword() async throws {
|
||||
func test_withEmptyUsernameOrPassword() throws {
|
||||
// GIVEN
|
||||
username = ""
|
||||
password = "password"
|
||||
|
Loading…
x
Reference in New Issue
Block a user