Updated the type of the "body" property in the Endpoint protocol to the Data type from Foundation.

This commit is contained in:
Javier Cicchelli 2022-12-04 03:04:57 +01:00
parent 01742cc4c6
commit 01d060d583
9 changed files with 19 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -40,7 +40,7 @@ final class GetMeEndpointInitTests: XCTestCase {
XCTAssertNil(endpoint.body)
}
func test_withEmptyUsernameOrPassword() async throws {
func test_withEmptyUsernameOrPassword() throws {
// GIVEN
username = ""
password = "password"