Skip to content

Commit 9471682

Browse files
committed
Update docs
1 parent aaf0a65 commit 9471682

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CLAUDE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ The framework is built around two core protocols:
7575

7676
**URLServer Protocol**: The `URLServer` protocol provides all URLSession-based functionality with default implementations. Only `baseUri` must be provided by conforming types.
7777

78-
**Network Observers**: The `NetworkObserver` protocol provides lifecycle callbacks (`willSendRequest`, `didReceiveResponse`, `didFail`) with type-safe context passing. Observer integration uses `AnyObserverToken` for type erasure.
78+
**Network Observers**: The `NetworkObserver` protocol provides lifecycle callbacks (`willSendRequest`, `didReceiveResponse`, `didFail`) with type-safe context passing. Observer integration uses `BoundObserverContext` (private) for type erasure.
7979

8080
**Request Configuration**: The `RequestConfiguring` protocol allows per-request async configuration at the call site, separate from server-level `buildRequest`.
8181

@@ -95,8 +95,8 @@ The framework is built around two core protocols:
9595

9696
**Test Structure** (`Tests/FTAPIKitTests/`):
9797
- Uses Swift Testing framework (`@Suite`, `@Test`, `#expect`)
98-
- Test files: `AsyncTests.swift`, `AsyncBuildRequestTests.swift`, `URLQueryTests.swift`, `NetworkObserverTests.swift`, `RequestConfiguringTests.swift`
99-
- Test utilities in `Mockups/`: `Servers.swift`, `Endpoints.swift`, `Models.swift`, `Errors.swift`, `MockNetworkObserver.swift`
98+
- Test files: `AsyncTests.swift`, `AsyncBuildRequestTests.swift`, `URLQueryTests.swift`, `NetworkObserverTests.swift`, `RequestConfiguringTests.swift`, `EndpointTypeTests.swift`, `ErrorHandlingTests.swift`
99+
- Test utilities in `Mockups/`: `Servers.swift`, `Endpoints.swift`, `Models.swift`, `Errors.swift`, `MockNetworkObserver.swift`, `MockTokenManager.swift`, `HTTPBinResponse.swift`
100100

101101
### Call Execution Pattern
102102

@@ -120,6 +120,8 @@ let fileURL = try await server.download(endpoint: endpoint)
120120

121121
- `APIError` protocol defines error handling interface
122122
- Default implementation: `APIError.Standard` (enum with connection, encoding, decoding, server, client, unhandled cases)
123+
- Network errors (`URLError`) and decoding errors are routed through `ErrorType` for consistent error handling
124+
- Encoding errors (from `buildStandardRequest`) propagate directly as `EncodingError` since they occur before the network request
123125
- Custom error types can be defined via `URLServer.ErrorType` associated type
124126

125127
## Package Management

Sources/FTAPIKit/Documentation.docc/Documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Built for Swift 6.1+ with full concurrency safety.
3131
### Request Configuration
3232

3333
- ``RequestConfiguring``
34+
- ``CompositeRequestConfiguring``
3435

3536
### Endpoint configuration
3637

0 commit comments

Comments
 (0)