diff --git a/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift b/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift index 08be7f7..0ba560b 100644 --- a/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift +++ b/Sources/AmiiboService/Public/Clients/AmiiboLiveClient.swift @@ -29,9 +29,12 @@ public struct AmiiboLiveClient: Sendable { /// Initializes this client with a transport for performing HTTP operations. /// - Parameter transport: A transport that performs HTTP operations. Defaults to a `URLSessionTransport` using the shared session. public init(transport: any ClientTransport = URLSessionTransport()) { + guard let serverURL = try? Servers.Server1.url() else { + fatalError("The server URL defined in the OpenAPI specification could not be resolved. Verify that the 'openapi.yaml' server definition is valid.") + } + self.client = .init( - // The force unwrapping implemented below assumes that the server definition from the OpenAPI specification is correct. - serverURL: try! Servers.Server1.url(), + serverURL: serverURL, configuration: .init(dateTranscoder: ISOTimestampTranscoder()), transport: transport )