AsyncHTTPClient is a new HTTP client library for Swift built on SwiftNIO. This library utilizes non-blocking IO which makes it ideal for use Swift servers.
From what I can tell OpenAPI Generator currently supports generating Swift 5 clients based on URLSession, Alamofire, and RxSwift. It would be great if we could add support for AsyncHTTPClient so that servers could generate non-blocking clients to interact with OpenAPI-compatible APIs.
Hey, here are some tips on how to add another http client library to swift 5 generator, if someone wants to take this task. I can help with guidance and code review.
The first thing it's to subclass RequestBuilder to implement the network stack with the library that you want. Here are two examples of that with URLSession and Alamofire.
Then create an implementation for RequestBuilderFactory that returns your new network stack implementation. Here are two examples of this with URLSession and Alamofire.
Then swap the network factory in PetstoreClientAPI.requestBuilderFactory.
Here is a PR that adds URLSession support and shows all of this.
Hope it helps 馃檪
Most helpful comment
Hey, here are some tips on how to add another http client library to swift 5 generator, if someone wants to take this task. I can help with guidance and code review.
The first thing it's to subclass RequestBuilder to implement the network stack with the library that you want. Here are two examples of that with URLSession and Alamofire.
Then create an implementation for RequestBuilderFactory that returns your new network stack implementation. Here are two examples of this with URLSession and Alamofire.
Then swap the network factory in PetstoreClientAPI.requestBuilderFactory.
Here is a PR that adds URLSession support and shows all of this.
Hope it helps 馃檪