Skip to content

Commit a919c65

Browse files
authored
Update all examples and integration tests to 0.3.0 (#325)
Update all examples and integration tests to 0.3.0 ### Motivation We're ready to release 0.3.0, so update all examples and integration tests, so that once tagged, the code uses the latest versions. ### Modifications Updated integration tests and examples, also made a few minor improvements. ### Result All code refers to 0.3.0. ### Test Plan Verified manually, but some of these might not pass because 0.3.0 of the generator doesn't exist yet - chicken and egg, but that's understood as part of this process. Reviewed by: simonjbeaumont Builds: ✔︎ pull request validation (5.10) - Build finished. ✔︎ pull request validation (5.8) - Build finished. ✔︎ pull request validation (5.9) - Build finished. ✔︎ pull request validation (compatibility test) - Build finished. ✔︎ pull request validation (docc test) - Build finished. ✔︎ pull request validation (nightly) - Build finished. ✔︎ pull request validation (soundness) - Build finished. ✖︎ pull request validation (integration test) - Build finished. #325
1 parent 9a6414c commit a919c65

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

Examples/GreetingService/Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ let package = Package(
2020
.macOS(.v13)
2121
],
2222
dependencies: [
23-
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.2.0")),
24-
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.2.0")),
25-
.package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.2.0")),
23+
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")),
24+
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")),
25+
.package(url: "https://github.com/swift-server/swift-openapi-vapor", .upToNextMinor(from: "0.3.0")),
2626
.package(url: "https://github.com/vapor/vapor", from: "4.76.0"),
2727
],
2828
targets: [

Examples/GreetingServiceClient/Package.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
import PackageDescription
1616

1717
let package = Package(
18-
name: "GreetingService",
18+
name: "GreetingServiceClient",
1919
platforms: [
2020
.macOS(.v13)
2121
],
2222
dependencies: [
23-
// TODO: When swift-openapi-generator is tagged with 0.3.0, stop depending on main.
24-
// .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0"),
25-
.package(url: "https://github.com/apple/swift-openapi-generator", branch: "main"),
23+
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")),
2624
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")),
2725
.package(url: "https://github.com/apple/swift-openapi-urlsession", .upToNextMinor(from: "0.3.0")),
2826
],

Examples/GreetingServiceClient/Sources/GreetingServiceClient/GreetingServiceClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ struct GreetingServiceClient {
2020
static func main() async throws {
2121
// Create an instance of the generated client type.
2222
let client: APIProtocol = Client(
23-
// Server.server1() is generated, derived from the server URL in the OpenAPI document.
24-
serverURL: try Servers.server1(),
23+
// Server.server2() is generated, derived from the server URL in the OpenAPI document.
24+
serverURL: try Servers.server2(),
2525
// URLSessionTransport conforms to ClientTransport and is provided by a separate package.
2626
transport: URLSessionTransport()
2727
)

Examples/GreetingServiceClient/Sources/GreetingServiceClient/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ info:
55
servers:
66
- url: https://example.com/api
77
description: Example
8+
- url: http://localhost:8080/api
9+
description: Localhost
810
paths:
911
/greet:
1012
get:

IntegrationTest/Package.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ let package = Package(
3232
)
3333
],
3434
dependencies: [
35-
// TODO: When swift-openapi-generator is tagged with 0.3.0, stop depending on main.
36-
// .package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0"),
37-
.package(url: "https://github.com/apple/swift-openapi-generator", branch: "main"),
35+
.package(url: "https://github.com/apple/swift-openapi-generator", .upToNextMinor(from: "0.3.0")),
3836
.package(url: "https://github.com/apple/swift-openapi-runtime", .upToNextMinor(from: "0.3.0")),
3937
],
4038
targets: [

0 commit comments

Comments
 (0)