Skip to content

Commit 3593a02

Browse files
committed
Rename Request.Parser to Request.DataParser
1 parent 5f67418 commit 3593a02

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Sources/APIKit/Request.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Result
1111
public protocol Request {
1212
/// The response type associated with the request type.
1313
associatedtype Response
14-
associatedtype Parser: DataParser
14+
associatedtype DataParser: APIKit.DataParser
1515

1616
/// The base URL.
1717
var baseURL: URL { get }
@@ -42,7 +42,7 @@ public protocol Request {
4242
var headerFields: [String: String] { get }
4343

4444
/// The parser object that states `Content-Type` to accept and parses response body.
45-
var dataParser: Parser { get }
45+
var dataParser: DataParser { get }
4646

4747
/// Intercepts `URLRequest` which is created by `Request.buildURLRequest()`. If an error is
4848
/// thrown in this method, the result of `Session.send()` turns `.failure(.requestError(error))`.
@@ -54,12 +54,12 @@ public protocol Request {
5454
/// The default implementation of this method is provided to throw `RequestError.unacceptableStatusCode`
5555
/// if the HTTP status code is not in `200..<300`.
5656
/// - Throws: `Error`
57-
func intercept(object: Parser.Parsed, urlResponse: HTTPURLResponse) throws -> Parser.Parsed
57+
func intercept(object: DataParser.Parsed, urlResponse: HTTPURLResponse) throws -> DataParser.Parsed
5858

5959
/// Build `Response` instance from raw response object. This method is called after
6060
/// `intercept(object:urlResponse:)` if it does not throw any error.
6161
/// - Throws: `Error`
62-
func response(from object: Parser.Parsed, urlResponse: HTTPURLResponse) throws -> Response
62+
func response(from object: DataParser.Parsed, urlResponse: HTTPURLResponse) throws -> Response
6363
}
6464

6565
public extension Request {
@@ -92,7 +92,7 @@ public extension Request {
9292
return urlRequest
9393
}
9494

95-
public func intercept(object: Parser.Parsed, urlResponse: HTTPURLResponse) throws -> Parser.Parsed {
95+
public func intercept(object: DataParser.Parsed, urlResponse: HTTPURLResponse) throws -> DataParser.Parsed {
9696
guard 200..<300 ~= urlResponse.statusCode else {
9797
throw ResponseError.unacceptableStatusCode(urlResponse.statusCode)
9898
}

0 commit comments

Comments
 (0)