From abfe558a66992ef1e896a577010f957915f30591 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 11 Dec 2023 14:04:24 +0100 Subject: [PATCH] Prep 1.0 (#37) ### Motivation Prep 1.0 - docs. ### Modifications See above. ### Result Updated for 1.0. ### Test Plan Previewed locally. --- Package.swift | 2 +- README.md | 14 +++----------- .../AsyncHTTPClientTransport.swift | 11 ++--------- .../Documentation.docc/Documentation.md | 13 ++----------- 4 files changed, 8 insertions(+), 32 deletions(-) diff --git a/Package.swift b/Package.swift index 486dc12..c1d69ba 100644 --- a/Package.swift +++ b/Package.swift @@ -36,7 +36,7 @@ let package = Package( dependencies: [ .package(url: "https://github.com/apple/swift-nio", from: "2.58.0"), .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.19.0"), - .package(url: "https://github.com/apple/swift-openapi-runtime", exact: "1.0.0-alpha.1"), + .package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"), .package(url: "https://github.com/apple/swift-http-types", from: "1.0.0"), .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), ], diff --git a/README.md b/README.md index 140a9f1..c8224ce 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # AsyncHTTPClient Transport for Swift OpenAPI Generator [![](https://img.shields.io/badge/docc-read_documentation-blue)](https://swiftpackageindex.com/swift-server/swift-openapi-async-http-client/documentation) +[![](https://img.shields.io/github/v/release/swift-server/swift-openapi-async-http-client)](https://github.com/swift-server/swift-openapi-async-http-client/releases) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswift-server%2Fswift-openapi-async-http-client%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/swift-server/swift-openapi-async-http-client) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswift-server%2Fswift-openapi-async-http-client%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/swift-server/swift-openapi-async-http-client) @@ -18,28 +19,19 @@ Use the transport with client code generated by [Swift OpenAPI Generator](https: Add the package dependency in your `Package.swift`: ```swift -.package( - url: "https://github.com/swift-server/swift-openapi-async-http-client", - exact: "1.0.0-alpha.1" -), +.package(url: "https://github.com/swift-server/swift-openapi-async-http-client", from: "1.0.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: ```swift .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](https://github.com/apple/swift-openapi-generator/issues) repository. - ## Documentation To learn more, check out the full [documentation](https://swiftpackageindex.com/swift-server/swift-openapi-async-http-client/documentation). diff --git a/Sources/OpenAPIAsyncHTTPClient/AsyncHTTPClientTransport.swift b/Sources/OpenAPIAsyncHTTPClient/AsyncHTTPClientTransport.swift index a43a074..d16220e 100644 --- a/Sources/OpenAPIAsyncHTTPClient/AsyncHTTPClientTransport.swift +++ b/Sources/OpenAPIAsyncHTTPClient/AsyncHTTPClientTransport.swift @@ -35,17 +35,11 @@ import protocol Foundation.LocalizedError /// /// let transport = AsyncHTTPClientTransport() /// -/// Create the base URL of the server to call using your client. If the server -/// URL was defined in the OpenAPI document, you find a generated method for it -/// on the `Servers` type, for example: -/// -/// let serverURL = try Servers.server1() -/// /// Instantiate the `Client` type generated by the Swift OpenAPI Generator for /// your provided OpenAPI document. For example: /// /// let client = Client( -/// serverURL: serverURL, +/// serverURL: URL(string: "https://example.com")!, /// transport: transport /// ) /// @@ -53,8 +47,7 @@ import protocol Foundation.LocalizedError /// example, if the OpenAPI document contains an HTTP operation with /// the identifier `checkHealth`, call it from Swift with: /// -/// let response = try await client.checkHealth(.init()) -/// // ... +/// let response = try await client.checkHealth() /// /// ### Provide a custom Client /// diff --git a/Sources/OpenAPIAsyncHTTPClient/Documentation.docc/Documentation.md b/Sources/OpenAPIAsyncHTTPClient/Documentation.docc/Documentation.md index f41c431..f4eb007 100644 --- a/Sources/OpenAPIAsyncHTTPClient/Documentation.docc/Documentation.md +++ b/Sources/OpenAPIAsyncHTTPClient/Documentation.docc/Documentation.md @@ -18,28 +18,19 @@ Use the transport with client code generated by [Swift OpenAPI Generator](https: Add the package dependency in your `Package.swift`: ```swift -.package( - url: "https://github.com/swift-server/swift-openapi-async-http-client", - exact: "1.0.0-alpha.1" -), +.package(url: "https://github.com/swift-server/swift-openapi-async-http-client", from: "1.0.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: ```swift .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](https://github.com/apple/swift-openapi-generator/issues) repository. - ## Topics ### Usage