Skip to content

Commit 5cf2c46

Browse files
authored
Merge pull request #52 from GoodRequest/remove-jsonpath
feat: Remove dependency on JSONPath (Sextant)
2 parents 065d3cd + f34d242 commit 5cf2c46

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

Package.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,18 @@ let package = Package(
1010
.macOS(.v10_15)
1111
],
1212
products: [
13-
// Products define the executables and libraries a package produces, and make them visible to other packages.
1413
.library(
1514
name: "GoodNetworking",
1615
targets: ["GoodNetworking"]
1716
)
1817
],
1918
dependencies: [
2019
// Dependencies declare other packages that this package depends on.
21-
.package(url: "https://github.com/KittyMac/Sextant.git", .upToNextMinor(from: "0.4.31"))
2220
],
2321
targets: [
24-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
25-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
2622
.target(
2723
name: "GoodNetworking",
28-
dependencies: [
29-
.product(name: "Sextant", package: "Sextant")
30-
],
24+
dependencies: [],
3125
path: "./Sources/GoodNetworking",
3226
resources: [.copy("PrivacyInfo.xcprivacy")],
3327
swiftSettings: [

Sources/GoodNetworking/Resource/ResourceOperations.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77

88
import Foundation
9-
import Hitch
10-
import Sextant
119

1210
// MARK: - Creatable
1311

@@ -245,21 +243,6 @@ public protocol Query: Readable where ReadResponse == Data {
245243

246244
}
247245

248-
public extension Query where Resource: Decodable {
249-
250-
/// Provides a default implementation for parsing the raw response data into a `Resource` using the query.
251-
///
252-
/// This method uses the specified query to extract and decode the data from the response.
253-
///
254-
/// - Parameter response: The raw response data received from the server.
255-
/// - Returns: The decoded `Resource` object.
256-
/// - Throws: A `NetworkError` if the parsing or decoding fails.
257-
nonisolated static func resource(from response: ReadResponse, updating resource: Resource?) throws(NetworkError) -> Resource {
258-
Sextant.shared.query(response, values: Hitch(string: query())) ?? .placeholder
259-
}
260-
261-
}
262-
263246
public extension Query {
264247

265248
/// Reads the raw data from the remote server using the provided session and request data.

0 commit comments

Comments
 (0)