Default the configuration parameter (#32)

Default the configuration parameter

### Motivation

The AsyncHTTPClient transport API has undergone changes in recent months and we didn't bring back the default initializer after we adopted the shared EventLoopGroup, allowing you to create a transport with just `let transport = AsyncHTTPClientTransport()`.

### Modifications

Default the configuration parameter in the initializer to be able to do that. It's already documented to work, but it doesn't.

### Result

Match the documented behavior of being able to use `let transport = AsyncHTTPClientTransport()`.

### Test Plan

Tests still pass.


Reviewed by: dnadoba

Builds:
     ✔︎ pull request validation (5.10) - Build finished. 
     ✔︎ pull request validation (5.9) - Build finished. 
     ✔︎ pull request validation (nightly) - Build finished. 
     ✔︎ pull request validation (soundness) - Build finished. 

https://github.com/swift-server/swift-openapi-async-http-client/pull/32
This commit is contained in:
Honza Dvorsky
2023-11-30 13:39:25 +01:00
committed by GitHub
parent 1ab51feec5
commit 7edc42113f
@@ -135,7 +135,7 @@ public struct AsyncHTTPClientTransport: ClientTransport {
/// Creates a new transport.
/// - Parameter configuration: A set of configuration values used by the transport.
public init(configuration: Configuration) {
public init(configuration: Configuration = .init()) {
self.init(configuration: configuration, requestSender: AsyncHTTPRequestSender())
}