mirror of
https://github.com/swift-server/swift-openapi-async-http-client.git
synced 2026-05-03 07:42:29 +00:00
5d0da418fd4319ad173309d435387b0234a962fa
Use an SSH URL to fetch Runtime in CI (Same as: https://github.com/apple/swift-openapi-generator/pull/3) ### Motivation Until the swift-openapi-runtime repository is made public, it cannot be cloned using a HTTPS package URL without authentication, which is what this package is using in its Package.swift. This means CI isn't able to run for this package. However, CI is able to clone this repository over SSH, which presents an opportunity for a temporary workaround. ### Modifications Add a temporary step to the Docker Compose CI flow, which creates a Git config in a shared ephemeral volume with the following contents: ```gitconfig [url "git@github.com:apple/swift-openapi-runtime"] insteadOf = https://github.com/apple/swift-openapi-runtime ``` ### Result The CI should be able to clone the private dependency and then succeed. ### Test Plan Locally, this works: ```console ❯ docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.2204.58.yaml run test ... + swift test -Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error ... Fetching https://github.com/apple/swift-openapi-runtime ... Fetched https://github.com/apple/swift-openapi-runtime (2.68s) ... Executed 86 tests, with 0 failures (0 unexpected) in 3.265 (3.265) seconds ``` Also, if we use can use the `shell` Docker Compose service to see things are configured correctly: ```console root@20ab69e3f292:/code# echo $GIT_CONFIG_GLOBAL /ci-gitconfig/gitconfig root@20ab69e3f292:/code# cat $GIT_CONFIG_GLOBAL [url "git@github.com:apple/swift-openapi-runtime"] insteadOf = https://github.com/apple/swift-openapi-runtime ``` Reviewed by: simonjbeaumont Builds: ✔︎ pull request validation (5.8) - 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/3
AsyncHTTPClient Transport for Swift OpenAPI Generator
A client transport that uses the HTTPClient type from the AsyncHTTPClient library to perform HTTP operations.
Use the transport with client code generated by Swift OpenAPI Generator.
Usage
Add the package dependency in your Package.swift:
.package(
url: "https://github.com/swift-server/swift-openapi-async-http-client",
.upToNextMinor(from: "0.1.0")
),
Note that this repository does not have a 1.0 tag yet, so the API is not stable.
Next, in your target, add OpenAPIAsyncHTTPClient to your dependencies:
.target(name: "MyTarget", dependencies: [
.product(name: "OpenAPIAsyncHTTPClient", package: "swift-openapi-async-http-client"),
],
Then, to get started, check out AsyncHTTPClientTransport.
Reporting issues
Please report any issues related to this library in the swift-openapi-generator repository.
Documentation
To learn more, check out the full documentation.
Description
Languages
Swift
100%